diff --git a/src/lib/deskflow/CoreArgs.h b/src/lib/deskflow/CoreArgs.h index 2cae48d34..6f3e64876 100644 --- a/src/lib/deskflow/CoreArgs.h +++ b/src/lib/deskflow/CoreArgs.h @@ -56,7 +56,7 @@ struct CoreArgs ); inline static const auto useHooksOption = - QCommandLineOption("useHooks", "Sets if hooks are used for windows desks", "value"); + QCommandLineOption("useHooks", "Sets if hooks are used on Windows", "value"); // Server Options inline static const auto peerCheckOption = QCommandLineOption( diff --git a/src/lib/platform/MSWindowsDesks.cpp b/src/lib/platform/MSWindowsDesks.cpp index c7e38979c..55c0a2ed7 100644 --- a/src/lib/platform/MSWindowsDesks.cpp +++ b/src/lib/platform/MSWindowsDesks.cpp @@ -106,10 +106,10 @@ static void send_mouse_input(DWORD dwFlags, DWORD dx, DWORD dy, DWORD dwData) // MSWindowsDesks::MSWindowsDesks( - bool isPrimary, bool noHooks, const IScreenSaver *screensaver, IEventQueue *events, IJob *updateKeys + bool isPrimary, bool useHooks, const IScreenSaver *screensaver, IEventQueue *events, IJob *updateKeys ) : m_isPrimary(isPrimary), - m_noHooks(noHooks), + m_useHooks(useHooks), m_isOnScreen(m_isPrimary), m_screensaver(screensaver), m_deskReady(&m_mutex, false), @@ -633,7 +633,7 @@ void MSWindowsDesks::deskThread(void *vdesk) continue; case DESKFLOW_MSG_SWITCH: - if (!m_noHooks) { + if (m_useHooks) { MSWindowsHook::uninstall(); if (m_screensaverNotify) { MSWindowsHook::uninstallScreenSaver(); @@ -712,7 +712,7 @@ void MSWindowsDesks::deskThread(void *vdesk) break; case DESKFLOW_MSG_SCREENSAVER: - if (!m_noHooks) { + if (m_useHooks) { if (msg.wParam != 0) { MSWindowsHook::installScreenSaver(); } else { diff --git a/src/lib/platform/MSWindowsDesks.h b/src/lib/platform/MSWindowsDesks.h index 439313b79..b7ae63b06 100644 --- a/src/lib/platform/MSWindowsDesks.h +++ b/src/lib/platform/MSWindowsDesks.h @@ -54,7 +54,7 @@ public: updated in a thread attached to the current desk. \p hookLibrary must be a handle to the hook library. */ - MSWindowsDesks(bool isPrimary, bool noHooks, const IScreenSaver *screensaver, IEventQueue *events, IJob *updateKeys); + MSWindowsDesks(bool isPrimary, bool useHooks, const IScreenSaver *screensaver, IEventQueue *events, IJob *updateKeys); ~MSWindowsDesks(); //! @name manipulators @@ -232,8 +232,8 @@ private: // true if screen is being used as a primary screen, false otherwise bool m_isPrimary; - // true if hooks are not to be installed (useful for debugging) - bool m_noHooks; + // true if hooks are to be installed (when debugging, it can be useful to disable hooks) + bool m_useHooks; // true if mouse has entered the screen bool m_isOnScreen; diff --git a/src/lib/platform/MSWindowsScreen.cpp b/src/lib/platform/MSWindowsScreen.cpp index 9dee3e0f2..106f67dd8 100644 --- a/src/lib/platform/MSWindowsScreen.cpp +++ b/src/lib/platform/MSWindowsScreen.cpp @@ -80,11 +80,11 @@ HINSTANCE MSWindowsScreen::s_windowInstance = nullptr; MSWindowsScreen *MSWindowsScreen::s_screen = nullptr; MSWindowsScreen::MSWindowsScreen( - bool isPrimary, bool noHooks, IEventQueue *events, bool enableLangSync, bool invertScrolling + bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync, bool invertScrolling ) : PlatformScreen(events, invertScrolling), m_isPrimary(isPrimary), - m_noHooks(noHooks), + m_useHooks(useHooks), m_isOnScreen(m_isPrimary), m_hasMouse(GetSystemMetrics(SM_MOUSEPRESENT) != 0), m_events(events) @@ -96,13 +96,13 @@ MSWindowsScreen::MSWindowsScreen( s_screen = this; try { - if (m_isPrimary && !m_noHooks) { + if (m_isPrimary && m_useHooks) { m_hook.loadLibrary(); } m_screensaver = new MSWindowsScreenSaver(); m_desks = new MSWindowsDesks( - m_isPrimary, m_noHooks, m_screensaver, m_events, + m_isPrimary, m_useHooks, m_screensaver, m_events, new TMethodJob(this, &MSWindowsScreen::updateKeysCB) ); m_keyState = new MSWindowsKeyState( diff --git a/src/lib/platform/MSWindowsScreen.h b/src/lib/platform/MSWindowsScreen.h index c740f9aad..3692d2f39 100644 --- a/src/lib/platform/MSWindowsScreen.h +++ b/src/lib/platform/MSWindowsScreen.h @@ -30,7 +30,7 @@ class MSWindowsScreen : public PlatformScreen { public: MSWindowsScreen( - bool isPrimary, bool noHooks, IEventQueue *events, bool enableLangSync = false, bool invetScrolling = false + bool isPrimary, bool useHooks, IEventQueue *events, bool enableLangSync = false, bool invetScrolling = false ); ~MSWindowsScreen() override; @@ -253,7 +253,7 @@ private: bool m_isPrimary; // true if hooks are not to be installed (useful for debugging) - bool m_noHooks; + bool m_useHooks; // true if mouse has entered the screen bool m_isOnScreen;