cosmic-comp/cosmic-comp-config
Niklas Herder 28258e5a5f cursor: Add idle-hide timeout
Adds a cursor_hide_timeout config key (Option<u32> seconds) to
CosmicCompConfig. When set, the cursor is hidden after the configured
period of pointer inactivity and revealed again by any pointer event.
Touch input does not count as activity (no visible cursor to surface).

Implementation:
- Per-seat hidden flag, calloop timer token, and last-armed Instant on
  CursorStateInner.
- notify_cursor_activity called from each pointer-related input branch
  (motion, button, axis, tablet) resets the flag and reschedules the
  timer; rapid successive calls are coalesced behind a 100ms throttle
  so high-frequency mice don't churn the calloop timer source.
- On timer fire, the hidden flag is set, draw_cursor short-circuits to
  an empty element list, and a render is scheduled. Active pointer
  grabs (drags, resizes) suppress the hide.
- Config reload arms or cancels the timer immediately; None as the
  configured value collapses the cancel path into the same function.

Closes #2231.

Drafted with Claude (Anthropic); reviewed and tested by the committer.
2026-05-22 14:14:17 +02:00
..
src cursor: Add idle-hide timeout 2026-05-22 14:14:17 +02:00
Cargo.toml chore: Update smithay 2026-04-27 14:51:46 -07:00