Skip to content

Add optional lock-aware jiggling pause/resume behavior#131

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/feature-respect-locked-state
Draft

Add optional lock-aware jiggling pause/resume behavior#131
Copilot wants to merge 3 commits into
masterfrom
copilot/feature-respect-locked-state

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Mouse Jiggler currently prevents sleep even after Win+L, which conflicts with users who want normal lock-screen power behavior. This change adds an opt-in setting to respect Windows session lock state by pausing jiggling while locked.

  • Behavior change: lock-aware pause/resume

    • Added Windows session event handling (SystemEvents.SessionSwitch) in MainForm.
    • When Respect lock state is enabled:
      • On SessionLock: jiggling is disabled if currently active.
      • On SessionUnlock: jiggling resumes only if it was auto-paused by the lock event.
    • Uses UI-thread marshaling for session callbacks and unsubscribes on form closing.
  • Settings + persistence

    • Added new user-scoped setting: RespectLockedState (default False).
    • Wired setting through:
      • Properties/Settings.settings
      • Properties/Settings.Designer.cs
      • App.config
    • Added MainForm.RespectLockedState property to synchronize UI and persisted settings.
  • UI update

    • Added new checkbox under Settings:
      • Respect lock state?
    • Connected checkbox change handler to persist and apply the setting.
  • Documentation touch-up

    • Updated README and project description text to mention optional lock-state pause behavior.
if (e.Reason == SessionSwitchReason.SessionLock && this.cbJiggling.Checked)
{
  this._resumeJigglingAfterUnlock = true;
  this.cbJiggling.Checked = false;
}
else if (e.Reason == SessionSwitchReason.SessionUnlock && this._resumeJigglingAfterUnlock)
{
  this._resumeJigglingAfterUnlock = false;
  this.cbJiggling.Checked = true;
}

Copilot AI linked an issue Apr 16, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add option to respect locked state for MouseJiggler Add optional lock-aware jiggling pause/resume behavior Apr 16, 2026
Copilot AI requested a review from cerebrate April 16, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: Respect Locked state

2 participants