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.
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.