fix: Invert noHooks to useHooks to match new config

This commit is contained in:
Nick Bolton 2025-10-14 13:28:53 +01:00 committed by Chris Rizzitello
parent 497813e198
commit 3ece50e292
5 changed files with 14 additions and 14 deletions

View file

@ -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(

View file

@ -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 {

View file

@ -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;

View file

@ -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<MSWindowsScreen>(this, &MSWindowsScreen::updateKeysCB)
);
m_keyState = new MSWindowsKeyState(

View file

@ -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;