diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 9bb9381ba..191661d42 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -104,12 +104,11 @@ const char *ClientApp::daemonName() const deskflow::Screen *ClientApp::createScreen() { - const bool invertScrolling = Settings::value(Settings::Client::InvertScrollDirection).toBool(); #if WINAPI_MSWINDOWS return new deskflow::Screen( new MSWindowsScreen( false, Settings::value(Settings::Core::UseHooks).toBool(), getEvents(), - Settings::value(Settings::Client::LanguageSync).toBool(), invertScrolling + Settings::value(Settings::Client::LanguageSync).toBool() ), getEvents() ); @@ -119,7 +118,7 @@ deskflow::Screen *ClientApp::createScreen() if (deskflow::platform::isWayland()) { #if WINAPI_LIBEI LOG_INFO("using ei screen for wayland"); - return new deskflow::Screen(new deskflow::EiScreen(false, getEvents(), true, invertScrolling), getEvents()); + return new deskflow::Screen(new deskflow::EiScreen(false, getEvents(), true), getEvents()); #else throw XNoEiSupport(); #endif @@ -129,9 +128,7 @@ deskflow::Screen *ClientApp::createScreen() #if WINAPI_XWINDOWS LOG_INFO("using legacy x windows screen"); return new deskflow::Screen( - new XWindowsScreen( - qPrintable(Settings::value(Settings::Core::Display).toString()), false, getEvents(), invertScrolling - ), + new XWindowsScreen(qPrintable(Settings::value(Settings::Core::Display).toString()), false, getEvents()), getEvents() ); @@ -139,8 +136,7 @@ deskflow::Screen *ClientApp::createScreen() #if WINAPI_CARBON return new deskflow::Screen( - new OSXScreen(getEvents(), false, Settings::value(Settings::Client::LanguageSync).toBool(), invertScrolling), - getEvents() + new OSXScreen(getEvents(), false, Settings::value(Settings::Client::LanguageSync).toBool()), getEvents() ); #endif } diff --git a/src/lib/deskflow/PlatformScreen.cpp b/src/lib/deskflow/PlatformScreen.cpp index cad0829ed..558ac7c25 100644 --- a/src/lib/deskflow/PlatformScreen.cpp +++ b/src/lib/deskflow/PlatformScreen.cpp @@ -10,10 +10,9 @@ #include "common/Settings.h" #include "deskflow/App.h" -PlatformScreen::PlatformScreen(IEventQueue *events, bool invertScrolling) - : IPlatformScreen(events), - m_invertScrollDirection(invertScrolling) +PlatformScreen::PlatformScreen(IEventQueue *events) : IPlatformScreen(events) { + m_invertScrollDirection = Settings::value(Settings::Client::InvertScrollDirection).toBool(); m_yScrollScale = std::clamp(Settings::value(Settings::Client::YScrollScale).toDouble(), 0.1, 10.0); } diff --git a/src/lib/deskflow/PlatformScreen.h b/src/lib/deskflow/PlatformScreen.h index 3696301d0..ad969a0ca 100644 --- a/src/lib/deskflow/PlatformScreen.h +++ b/src/lib/deskflow/PlatformScreen.h @@ -23,7 +23,7 @@ public: int32_t xDelta; int32_t yDelta; }; - explicit PlatformScreen(IEventQueue *events, bool invertScrollDirection); + explicit PlatformScreen(IEventQueue *events); ~PlatformScreen() override = default; // IScreen overrides diff --git a/src/lib/platform/EiScreen.cpp b/src/lib/platform/EiScreen.cpp index a55e7a60b..60297aaf2 100644 --- a/src/lib/platform/EiScreen.cpp +++ b/src/lib/platform/EiScreen.cpp @@ -36,8 +36,8 @@ struct ScrollRemainder namespace deskflow { -EiScreen::EiScreen(bool isPrimary, IEventQueue *events, bool usePortal, bool invertScrolling) - : PlatformScreen{events, invertScrolling}, +EiScreen::EiScreen(bool isPrimary, IEventQueue *events, bool usePortal) + : PlatformScreen{events}, m_isPrimary{isPrimary}, m_events{events}, m_clipboard{new WlClipboardCollection()}, diff --git a/src/lib/platform/EiScreen.h b/src/lib/platform/EiScreen.h index 3d84aff32..5fad4b772 100644 --- a/src/lib/platform/EiScreen.h +++ b/src/lib/platform/EiScreen.h @@ -34,7 +34,7 @@ using ClipboardInfo = IScreen::ClipboardInfo; class EiScreen : public PlatformScreen { public: - EiScreen(bool isPrimary, IEventQueue *events, bool usePortal, bool invertScrolling = false); + EiScreen(bool isPrimary, IEventQueue *events, bool usePortal); ~EiScreen() override; // IScreen overrides diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index 04cf9dd10..606174e84 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -79,10 +79,8 @@ HINSTANCE MSWindowsScreen::s_windowInstance = nullptr; MSWindowsScreen *MSWindowsScreen::s_screen = nullptr; -MSWindowsScreen::MSWindowsScreen( - bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync, bool invertScrolling -) - : PlatformScreen(events, invertScrolling), +MSWindowsScreen::MSWindowsScreen(bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync) + : PlatformScreen(events), m_isPrimary(isPrimary), m_useHooks(useHooks), m_isOnScreen(m_isPrimary), diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h index ce2458df6..fb1489121 100644 --- a/src/lib/platform/MSWindowsScreen.h +++ b/src/lib/platform/MSWindowsScreen.h @@ -29,9 +29,7 @@ class MSWindowsDropTarget; class MSWindowsScreen : public PlatformScreen { public: - MSWindowsScreen( - bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync = false, bool invetScrolling = false - ); + MSWindowsScreen(bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync = false); ~MSWindowsScreen() override; //! @name manipulators diff --git a/src/lib/platform/OSXScreen.h b/src/lib/platform/OSXScreen.h index a912a378f..3e5cc6a29 100644 --- a/src/lib/platform/OSXScreen.h +++ b/src/lib/platform/OSXScreen.h @@ -43,7 +43,7 @@ class Mutex; class OSXScreen : public PlatformScreen { public: - OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync = false, bool invertScrolling = false); + OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync = false); virtual ~OSXScreen(); diff --git a/src/lib/platform/OSXScreen.mm b/src/lib/platform/OSXScreen.mm index e046dc71e..a7e53d46e 100644 --- a/src/lib/platform/OSXScreen.mm +++ b/src/lib/platform/OSXScreen.mm @@ -74,8 +74,8 @@ void avoidHesitatingCursor(); bool OSXScreen::s_testedForGHOM = false; bool OSXScreen::s_hasGHOM = false; -OSXScreen::OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync, bool invertScrolling) - : PlatformScreen(events, invertScrolling), +OSXScreen::OSXScreen(IEventQueue *events, bool isPrimary, bool enableLangSync) + : PlatformScreen(events), m_isPrimary(isPrimary), m_isOnScreen(m_isPrimary), m_cursorPosValid(false), diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 72b5ef013..76bf26c01 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -82,8 +82,8 @@ static int xi_opcode; XWindowsScreen *XWindowsScreen::s_screen = nullptr; -XWindowsScreen::XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events, bool invertScrolling) - : PlatformScreen(events, invertScrolling), +XWindowsScreen::XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events) + : PlatformScreen(events), m_isPrimary(isPrimary), m_isOnScreen(m_isPrimary), m_events(events) diff --git a/src/lib/platform/XWindowsScreen.h b/src/lib/platform/XWindowsScreen.h index 94279e5ab..f0471fe1d 100644 --- a/src/lib/platform/XWindowsScreen.h +++ b/src/lib/platform/XWindowsScreen.h @@ -28,7 +28,7 @@ class XWindowsScreenSaver; class XWindowsScreen : public PlatformScreen { public: - XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events, bool invertScrolling = false); + XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events); ~XWindowsScreen() override; //! @name manipulators