diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 82d288e96..9bb9381ba 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -130,8 +130,7 @@ deskflow::Screen *ClientApp::createScreen() LOG_INFO("using legacy x windows screen"); return new deskflow::Screen( new XWindowsScreen( - qPrintable(Settings::value(Settings::Core::Display).toString()), false, - Settings::value(Settings::Client::ScrollSpeed).toInt(), getEvents(), invertScrolling + qPrintable(Settings::value(Settings::Core::Display).toString()), false, getEvents(), invertScrolling ), getEvents() ); diff --git a/src/lib/deskflow/ServerApp.cpp b/src/lib/deskflow/ServerApp.cpp index 13077b1a2..2e69adcd0 100644 --- a/src/lib/deskflow/ServerApp.cpp +++ b/src/lib/deskflow/ServerApp.cpp @@ -419,7 +419,7 @@ deskflow::Screen *ServerApp::createScreen() #if WINAPI_XWINDOWS LOG_INFO("using legacy x windows screen"); return new deskflow::Screen( - new XWindowsScreen(qPrintable(Settings::value(Settings::Core::Display).toString()), true, 0, getEvents()), + new XWindowsScreen(qPrintable(Settings::value(Settings::Core::Display).toString()), true, getEvents()), getEvents() ); #elif WINAPI_CARBON diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 25e7df1da..72b5ef013 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -82,19 +82,13 @@ static int xi_opcode; XWindowsScreen *XWindowsScreen::s_screen = nullptr; -XWindowsScreen::XWindowsScreen( - const char *displayName, bool isPrimary, int mouseScrollDelta, IEventQueue *events, bool invertScrolling -) +XWindowsScreen::XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events, bool invertScrolling) : PlatformScreen(events, invertScrolling), m_isPrimary(isPrimary), - m_mouseScrollDelta(mouseScrollDelta), m_isOnScreen(m_isPrimary), m_events(events) { assert(s_screen == nullptr); - - if (mouseScrollDelta == 0) - m_mouseScrollDelta = 120; s_screen = this; if (XInitThreads() == 0) { @@ -823,12 +817,11 @@ void XWindowsScreen::fakeMouseWheel(int32_t, int32_t yDelta) const yDelta = -yDelta; } - if (yDelta < m_mouseScrollDelta) { - LOG_WARN("wheel scroll delta (%d) smaller than threshold (%d)", yDelta, m_mouseScrollDelta); - } + // Delta for a "click" + static const auto s_mouseDelta = 120; // send as many clicks as necessary - for (; yDelta >= m_mouseScrollDelta; yDelta -= m_mouseScrollDelta) { + for (; yDelta >= 0; yDelta -= s_mouseDelta) { XTestFakeButtonEvent(m_display, xButton, True, CurrentTime); XTestFakeButtonEvent(m_display, xButton, False, CurrentTime); } diff --git a/src/lib/platform/XWindowsScreen.h b/src/lib/platform/XWindowsScreen.h index 4c436028e..94279e5ab 100644 --- a/src/lib/platform/XWindowsScreen.h +++ b/src/lib/platform/XWindowsScreen.h @@ -28,9 +28,7 @@ class XWindowsScreenSaver; class XWindowsScreen : public PlatformScreen { public: - XWindowsScreen( - const char *displayName, bool isPrimary, int mouseScrollDelta, IEventQueue *events, bool invertScrolling = false - ); + XWindowsScreen(const char *displayName, bool isPrimary, IEventQueue *events, bool invertScrolling = false); ~XWindowsScreen() override; //! @name manipulators @@ -167,7 +165,6 @@ private: // true if screen is being used as a primary screen, false otherwise bool m_isPrimary; - int m_mouseScrollDelta; Display *m_display = nullptr; Window m_root = None;