Skip to content

Fix idle detection ignoring disabled preference on suspend/lock - #113

Merged
Onatcer merged 1 commit into
solidtime-io:mainfrom
nicoeg:fix/idle-detection-respect-preference
May 12, 2026
Merged

Onatcer merged 1 commit into
solidtime-io:mainfrom
nicoeg:fix/idle-detection-respect-preference

Conversation

@nicoeg

@nicoeg nicoeg commented May 12, 2026

Copy link
Copy Markdown
Contributor

It's annoying to keep having to dismiss the pop-up when opening the computer after it has been closed when the "Enable idle detection" preference is disabled.

I could btw not see any tests for idle detection in general, so I chose not to add any. Let me know if you want me to

The powerMonitor suspend, lock-screen, resume, and unlock-screen handlers
fired regardless of the idleDetectionEnabled preference, so closing the
Mac lid (or locking the screen) still tracked an idle period and popped
the idle dialog on resume — even with idle detection turned off.

Guard each handler with idleDetectionEnabled so these events are ignored
when the user has disabled the feature.
@CLAassistant

CLAassistant commented May 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Onatcer

Onatcer commented May 12, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution, I'll look into adding tests but i think we have to mock quite a lot of stuff here and there is not that much logic in the idle detection itself (however, this is clearly a logic bug).

@Onatcer
Onatcer merged commit 9f7c4fc into solidtime-io:main May 12, 2026
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.

3 participants