Commit Graph
3 Commits
Author SHA1 Message Date
me0nline a969c91c28 feat(aw): scan both active foreground and visible desktop windows for distractions
Previously, fallback window detection only checked user32.GetForegroundWindow().
If the user had YouTube Shorts open in Chrome on a second monitor or behind the terminal,
it was ignored.

Now check_for_distraction():
1. Checks the active foreground window first.
2. If not a distraction, scans all visible top-level desktop windows via find_window_by_match().
3. Immediately wakes the cat from sleeping or sitting if any distraction window is discovered.
2026-09-08 23:38:00 +02:00
me0nline 4d1d7cc655 perf(aw): run ActivityWatch polling in background thread to eliminate UI freezes
Synchronous urllib calls in the 60 FPS main loop caused a 3-second network
connect timeout every 5 seconds whenever ActivityWatch was offline (due to
Windows IPv6/IPv4 localhost resolution). This completely froze the main thread,
stalled the Windows message pump, and triggered Windows Hung-App detection
(hourglass / wait cursor).

ActivityWatchClient now polls in a dedicated daemon worker thread:
- All socket connections and HTTP timeouts occur in the background thread.
- get_current_window_event() reads cached state in 0ms without blocking.
- Fallback to native Win32 window APIs is immediate with zero latency.
2026-09-08 23:26:21 +02:00
me0nline ddf99b8664 feat(activitywatch): add ActivityWatch client with native fallback 2026-09-08 23:04:44 +02:00