fix: idle detection errors and system freezes after hibernation

- Test idle detection methods only once during initialization to prevent repeated failures
- Add snap environment detection with automatic method filtering
- Add proper snap plugs for system-observe and login-session-observe interfaces
- Improve DBus handling by trying gdbus first (works better in snap environments)
- Add rate-limited error logging to prevent log spam
- Add snap install hook to guide users on connecting required interfaces
- Ensure graceful fallback to 0 (not idle) when detection fails

This prevents the system freezes that occurred after hibernation due to repeated
failing idle detection attempts, and improves snap compatibility for DBus access.
This commit is contained in:
Johannes Millan 2025-06-21 08:43:24 +02:00
parent c71a7d480f
commit fc343b801b
3 changed files with 51 additions and 15 deletions

View file

@ -61,6 +61,19 @@ snap:
autoStart: true
base: core22
confinement: strict
plugs:
- default
- desktop
- desktop-legacy
- wayland
- x11
- unity7
- home
- network
- browser-support
- password-manager-service
- system-observe
- login-session-observe
mac:
appId: com.super-productivity.app