diff --git a/src/modules/MouseUtils/CursorWrap/dllmain.cpp b/src/modules/MouseUtils/CursorWrap/dllmain.cpp index add9fb7f92..b172f1c8b6 100644 --- a/src/modules/MouseUtils/CursorWrap/dllmain.cpp +++ b/src/modules/MouseUtils/CursorWrap/dllmain.cpp @@ -198,6 +198,10 @@ public: // Start listening for external trigger event so we can invoke the same logic as the activation hotkey. m_triggerEventHandle = CreateEventW(nullptr, false, false, CommonSharedConstants::CURSOR_WRAP_TRIGGER_EVENT); m_terminateEventHandle = CreateEventW(nullptr, false, false, nullptr); + if (m_triggerEventHandle) + { + ResetEvent(m_triggerEventHandle); + } if (m_triggerEventHandle && m_terminateEventHandle) { m_listening = true; @@ -212,8 +216,16 @@ public: // Create message window for display change notifications RegisterForDisplayChanges(); - StartMouseHook(); - Logger::info("CursorWrap enabled - mouse hook started"); + // Only start the mouse hook automatically if auto-activate is enabled + if (m_autoActivate) + { + StartMouseHook(); + Logger::info("CursorWrap enabled - mouse hook started (auto-activate on)"); + } + else + { + Logger::info("CursorWrap enabled - waiting for activation hotkey (auto-activate off)"); + } while (m_listening) { diff --git a/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs index bd6a431a20..678c090397 100644 --- a/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs @@ -1006,13 +1006,6 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels GeneralSettingsConfig.Enabled.CursorWrap = value; OnPropertyChanged(nameof(IsCursorWrapEnabled)); - // Auto-enable the AutoActivate setting when CursorWrap is enabled - // This ensures cursor wrapping is active immediately after enabling - if (value && !_cursorWrapAutoActivate) - { - CursorWrapAutoActivate = true; - } - OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(GeneralSettingsConfig); SendConfigMSG(outgoing.ToString());