From 5e8a6f0bcb47b78f7f283f0242d12bd8c0f6c6f9 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Wed, 4 Feb 2026 18:16:38 -0500 Subject: [PATCH] fix: vertical scroll scaling on all platforms fixes: #9120 --- doc/user/configuration.md | 1 + src/lib/common/Settings.cpp | 4 +-- src/lib/common/Settings.h | 2 ++ src/lib/deskflow/PlatformScreen.cpp | 4 ++- src/lib/deskflow/PlatformScreen.h | 7 ++++ src/lib/gui/dialogs/SettingsDialog.cpp | 4 +-- src/lib/gui/dialogs/SettingsDialog.ui | 47 +++++++++++++++++++++----- translations/deskflow_es.ts | 16 ++++----- translations/deskflow_it.ts | 16 ++++----- translations/deskflow_ja.ts | 16 ++++----- translations/deskflow_ko.ts | 16 ++++----- translations/deskflow_ru.ts | 16 ++++----- translations/deskflow_zh_CN.ts | 16 ++++----- 13 files changed, 104 insertions(+), 61 deletions(-) diff --git a/doc/user/configuration.md b/doc/user/configuration.md index e3b98d5ad..9f6bf22a3 100644 --- a/doc/user/configuration.md +++ b/doc/user/configuration.md @@ -57,6 +57,7 @@ It will begin with `[client]` | invertScrollDirection | `true` or `false` | Invert scroll on this client [default: false] | | languageSync | `true` or `false` | Sync to server language [default: true] | | remoteHost | `IP` or `hostname` | The remote host(s) to connect to. Use a comma seperated list when you want to try severial hosts | +| yScrollScale | Double 0.1 - 10.0 | Mouse scrolling will be scaled by this amount on the client [default: 1.0] | | xdpRestoreToken | UUID | Restore token provided by XDG portals | ### Core diff --git a/src/lib/common/Settings.cpp b/src/lib/common/Settings.cpp index cb8d6cd5d..047b2623a 100644 --- a/src/lib/common/Settings.cpp +++ b/src/lib/common/Settings.cpp @@ -204,8 +204,8 @@ QVariant Settings::defaultValue(const QString &key) if (key == Daemon::LogFile) return QStringLiteral("%1/%2-daemon.log").arg(Settings::settingsPath(), kAppId); - if (key == Client::ScrollSpeed) - return 120; + if (key == Client::YScrollScale) + return 1.0; return QVariant(); } diff --git a/src/lib/common/Settings.h b/src/lib/common/Settings.h index a1f972f40..3c6d6864f 100644 --- a/src/lib/common/Settings.h +++ b/src/lib/common/Settings.h @@ -36,6 +36,7 @@ public: { inline static const auto InvertScrollDirection = QStringLiteral("client/invertScrollDirection"); inline static const auto ScrollSpeed = QStringLiteral("client/yscroll"); + inline static const auto YScrollScale = QStringLiteral("client/yScrollScale"); inline static const auto LanguageSync = QStringLiteral("client/languageSync"); inline static const auto RemoteHost = QStringLiteral("client/remoteHost"); inline static const auto XdpRestoreToken = QStringLiteral("client/xdpRestoreToken"); @@ -195,6 +196,7 @@ private: , Settings::Client::LanguageSync , Settings::Client::RemoteHost , Settings::Client::ScrollSpeed + , Settings::Client::YScrollScale , Settings::Client::XdpRestoreToken , Settings::Core::CoreMode , Settings::Core::Interface diff --git a/src/lib/deskflow/PlatformScreen.cpp b/src/lib/deskflow/PlatformScreen.cpp index 362a98afa..4a3748169 100644 --- a/src/lib/deskflow/PlatformScreen.cpp +++ b/src/lib/deskflow/PlatformScreen.cpp @@ -7,13 +7,14 @@ #include "deskflow/PlatformScreen.h" #include "base/DirectionTypes.h" +#include "common/Settings.h" #include "deskflow/App.h" PlatformScreen::PlatformScreen(IEventQueue *events, bool invertScrolling) : IPlatformScreen(events), m_invertScrollDirection(invertScrolling) { - // do nothing + m_scrollScale = std::clamp(Settings::value(Settings::Client::YScrollScale).toDouble(), 0.1, 10.0); } void PlatformScreen::updateKeyMap() @@ -91,6 +92,7 @@ void PlatformScreen::clearStaleModifiers() int32_t PlatformScreen::mapClientScrollDirection(int32_t x) const { + x *= m_scrollScale; return (m_invertScrollDirection ? -x : x); } diff --git a/src/lib/deskflow/PlatformScreen.h b/src/lib/deskflow/PlatformScreen.h index 512682f71..3b65ca627 100644 --- a/src/lib/deskflow/PlatformScreen.h +++ b/src/lib/deskflow/PlatformScreen.h @@ -114,4 +114,11 @@ private: * This member is used only on client side. */ bool m_invertScrollDirection = false; + + /** + * @brief m_scrollScale + * This member is used to scale the scroll speed + * It is only used on the client side + */ + double m_scrollScale = 1.0; }; diff --git a/src/lib/gui/dialogs/SettingsDialog.cpp b/src/lib/gui/dialogs/SettingsDialog.cpp index 7545075ee..8e39280e2 100644 --- a/src/lib/gui/dialogs/SettingsDialog.cpp +++ b/src/lib/gui/dialogs/SettingsDialog.cpp @@ -186,7 +186,7 @@ void SettingsDialog::accept() Settings::setValue(Settings::Gui::CloseToTray, ui->cbCloseToTray->isChecked()); Settings::setValue(Settings::Gui::SymbolicTrayIcon, ui->rbIconMono->isChecked()); Settings::setValue(Settings::Security::CheckPeers, ui->cbRequireClientCert->isChecked()); - Settings::setValue(Settings::Client::ScrollSpeed, ui->sbScrollSpeed->value()); + Settings::setValue(Settings::Client::YScrollScale, ui->sbYScrollScale->value()); Settings::setValue(Settings::Core::Language, I18N::nativeTo639Name(ui->comboLanguage->currentText())); Settings::setValue(Settings::Log::GuiDebug, ui->cbGuiDebug->isChecked()); Settings::setValue(Settings::Core::UseWlClipboard, ui->cbUseWlClipboard->isChecked()); @@ -215,7 +215,7 @@ void SettingsDialog::loadFromConfig() ui->cbCloseToTray->setChecked(Settings::value(Settings::Gui::CloseToTray).toBool()); ui->cbElevateDaemon->setChecked(Settings::value(Settings::Daemon::Elevate).toBool()); ui->cbAutoUpdate->setChecked(Settings::value(Settings::Gui::AutoUpdateCheck).toBool()); - ui->sbScrollSpeed->setValue(Settings::value(Settings::Client::ScrollSpeed).toInt()); + ui->sbYScrollScale->setValue(Settings::value(Settings::Client::YScrollScale).toDouble()); ui->cbGuiDebug->setChecked(Settings::value(Settings::Log::GuiDebug).toBool()); ui->cbUseWlClipboard->setChecked(Settings::value(Settings::Core::UseWlClipboard).toBool()); ui->cbShowVersion->setChecked(Settings::value(Settings::Gui::ShowVersionInTitle).toBool()); diff --git a/src/lib/gui/dialogs/SettingsDialog.ui b/src/lib/gui/dialogs/SettingsDialog.ui index efcd23f30..569c935ca 100644 --- a/src/lib/gui/dialogs/SettingsDialog.ui +++ b/src/lib/gui/dialogs/SettingsDialog.ui @@ -55,38 +55,69 @@ - Invert scroll direction on this computer + Invert vertical scroll direction on this computer - - + + + + + 0 + 0 + + - Scroll Speed + Vertical Scroll Scale - - + + 0 0 + + true + true + + QAbstractSpinBox::CorrectionMode::CorrectToNearestValue + - 1 + 0.100000000000000 - 1000 + 10.000000000000000 + + + 0.500000000000000 + + + 1.000000000000000 + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index 6a35d7889..c71d12f1a 100644 --- a/translations/deskflow_es.ts +++ b/translations/deskflow_es.ts @@ -1112,14 +1112,6 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU Use server's keyboard language on this computer Utilice el idioma del teclado del servidor en esta computadora - - Invert scroll direction on this computer - Invertir la dirección de desplazamiento en esta computadora - - - Scroll Speed - Velocidad de desplazamiento - App Aplicación @@ -1324,6 +1316,14 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU Include version in the window title Incluir la versión en el título de la ventana + + Invert vertical scroll direction on this computer + Invertir la dirección del desplazamiento vertical en este ordenador + + + Vertical Scroll Scale + Escala de desplazamiento vertical + i18n diff --git a/translations/deskflow_it.ts b/translations/deskflow_it.ts index 2f4c8be6e..c97352087 100644 --- a/translations/deskflow_it.ts +++ b/translations/deskflow_it.ts @@ -1112,14 +1112,6 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf Use server's keyboard language on this computer Usa la lingua della tastiera del server su questo computer - - Invert scroll direction on this computer - Inverti la direzione di scorrimento su questo computer - - - Scroll Speed - Velocità di scorrimento - App App @@ -1324,6 +1316,14 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf Include version in the window title Includi la versione nel titolo della finestra + + Invert vertical scroll direction on this computer + Inverti la direzione dello scorrimento verticale su questo computer + + + Vertical Scroll Scale + Scala di scorrimento verticale + i18n diff --git a/translations/deskflow_ja.ts b/translations/deskflow_ja.ts index 39eb7aa19..7a6b717be 100644 --- a/translations/deskflow_ja.ts +++ b/translations/deskflow_ja.ts @@ -1113,14 +1113,6 @@ Enabling this setting will disable the server config GUI. Use server's keyboard language on this computer サーバー側のキーボード言語をこのコンピューターで使用する - - Invert scroll direction on this computer - このコンピューターのスクロール方向を反転する - - - Scroll Speed - スクロール速度 - App アプリケーション @@ -1325,6 +1317,14 @@ Enabling this setting will disable the server config GUI. Include version in the window title ウィンドウタイトルにバージョン情報を含める + + Invert vertical scroll direction on this computer + このコンピューターで垂直スクロールの方向を反転させる + + + Vertical Scroll Scale + 垂直スクロールスケール + i18n diff --git a/translations/deskflow_ko.ts b/translations/deskflow_ko.ts index 8c07d9c17..7dad9b30f 100644 --- a/translations/deskflow_ko.ts +++ b/translations/deskflow_ko.ts @@ -1111,14 +1111,6 @@ Enabling this setting will disable the server config GUI. Use server's keyboard language on this computer 이 컴퓨터에서 서버의 키보드 언어 사용 - - Invert scroll direction on this computer - 이 컴퓨터의 스크롤 방향 반전 - - - Scroll Speed - 스크롤 속도 - App @@ -1323,6 +1315,14 @@ Enabling this setting will disable the server config GUI. Include version in the window title 창 제목에 버전 정보 포함 + + Invert vertical scroll direction on this computer + 이 컴퓨터에서 세로 스크롤 방향을 반전합니다 + + + Vertical Scroll Scale + 수직 스크롤 스케일 + i18n diff --git a/translations/deskflow_ru.ts b/translations/deskflow_ru.ts index 7fd548173..038cf2a5b 100644 --- a/translations/deskflow_ru.ts +++ b/translations/deskflow_ru.ts @@ -1111,14 +1111,6 @@ Enabling this setting will disable the server config GUI. Use server's keyboard language on this computer Использовать язык клавиатуры сервера на этом компьютере - - Invert scroll direction on this computer - Инвертировать направление прокрутки на этом компьютере - - - Scroll Speed - Скорость прокрутки - App Приложение @@ -1323,6 +1315,14 @@ Enabling this setting will disable the server config GUI. Include version in the window title Включить номер версии в заголовок окна + + Invert vertical scroll direction on this computer + Инвертировать направление вертикальной прокрутки на этом компьютере + + + Vertical Scroll Scale + Вертикальная шкала прокрутки + i18n diff --git a/translations/deskflow_zh_CN.ts b/translations/deskflow_zh_CN.ts index 97cf0d785..f17c82ca1 100644 --- a/translations/deskflow_zh_CN.ts +++ b/translations/deskflow_zh_CN.ts @@ -1113,14 +1113,6 @@ Enabling this setting will disable the server config GUI. Use server's keyboard language on this computer 在此计算机上使用服务器的键盘语言 - - Invert scroll direction on this computer - 反转此计算机上的滚动方向 - - - Scroll Speed - 滚动速度 - App 应用程序 @@ -1325,6 +1317,14 @@ Enabling this setting will disable the server config GUI. Include version in the window title 在窗口标题中包含版本信息 + + Invert vertical scroll direction on this computer + 在此计算机上反转垂直滚动方向 + + + Vertical Scroll Scale + 垂直滚动比例 + i18n