GRI-2112: hide the mouse pointer when it is not moving #259

Merged
vivy merged 2 commits from fix/GRI-2112-hide-idle-cursor into dev 2026-11-15 23:11:00 +00:00
Member

Summary

  • The player hides the mouse pointer after [display] hide_cursor_after_secs of no movement (default 3 s; GRIMOIRIX_SIGNAGE_HIDE_CURSOR_AFTER_SECS overrides; 0 means never — GRI-1884, no hard-coded value).
  • It comes back at once on the next movement, click or key press, then hides again after the same wait.
  • Covers every content kind: the toplevel plus each content widget's own gdk::Window (image, gtksink video, WebKit) are blanked together, so a web page cannot keep showing its own cursor under the player.
  • Done entirely inside the player (one gdk::Cursor::for_display(.., BlankCursor)), no unclutter or extra package.
  • The hide/show decision (client::cursor_idle::CursorIdle) is pure logic with no GTK dependency, so it is unit-tested without a display; client::renderer::cursor::CursorController is the GTK/GDK wiring around it, tested under xvfb-run (gtk-renderer feature).
  • Documented in plan/operations/deployment.md.

Test plan

  • cursor_idle::tests::* — pure idle-timer decision: fresh/visible, idle past the wait/hidden, movement resets it, 0 never hides. No display needed.
  • config::tests::hide_cursor_after_secs_* — default, env override, file read, bad value refused.
  • renderer::cursor::tests::the_idle_timer_hides_and_shows_the_cursor_and_respects_never (run under xvfb-run, gtk-renderer feature) — the "Done when" scenario against a real gdk::Window: move → visible, wait → hidden (blank cursor), move → visible again; hide_after_secs = 0 never hides regardless of how long it sits idle.

Verified locally: SIGNAGE_TEST_DATABASE_URL=... ./scripts/local-gates.sh --rust-only — every gate passed (default features, no gtk-renderer — matches CI). Additionally, by hand: xvfb-run -a cargo test -p client --features gtk-renderer — all 95 lib tests + integration tests pass, and cargo build -p client --features gtk-renderer --bin grimoirix-signage-client builds clean.

## Summary - The player hides the mouse pointer after `[display] hide_cursor_after_secs` of no movement (default 3 s; `GRIMOIRIX_SIGNAGE_HIDE_CURSOR_AFTER_SECS` overrides; `0` means never — GRI-1884, no hard-coded value). - It comes back at once on the next movement, click or key press, then hides again after the same wait. - Covers every content kind: the toplevel plus each content widget's own `gdk::Window` (image, `gtksink` video, `WebKit`) are blanked together, so a web page cannot keep showing its own cursor under the player. - Done entirely inside the player (one `gdk::Cursor::for_display(.., BlankCursor)`), no `unclutter` or extra package. - The hide/show decision (`client::cursor_idle::CursorIdle`) is pure logic with no GTK dependency, so it is unit-tested without a display; `client::renderer::cursor::CursorController` is the GTK/GDK wiring around it, tested under `xvfb-run` (`gtk-renderer` feature). - Documented in `plan/operations/deployment.md`. ## Test plan - [x] `cursor_idle::tests::*` — pure idle-timer decision: fresh/visible, idle past the wait/hidden, movement resets it, `0` never hides. No display needed. - [x] `config::tests::hide_cursor_after_secs_*` — default, env override, file read, bad value refused. - [x] `renderer::cursor::tests::the_idle_timer_hides_and_shows_the_cursor_and_respects_never` (run under `xvfb-run`, `gtk-renderer` feature) — the "Done when" scenario against a real `gdk::Window`: move → visible, wait → hidden (blank cursor), move → visible again; `hide_after_secs = 0` never hides regardless of how long it sits idle. Verified locally: `SIGNAGE_TEST_DATABASE_URL=... ./scripts/local-gates.sh --rust-only` — every gate passed (default features, no `gtk-renderer` — matches CI). Additionally, by hand: `xvfb-run -a cargo test -p client --features gtk-renderer` — all 95 lib tests + integration tests pass, and `cargo build -p client --features gtk-renderer --bin grimoirix-signage-client` builds clean.
GRI-2112: hide the mouse pointer when it is not moving
All checks were successful
CI / the pre-push hook (pull_request) Successful in 4s
CI / cargo fmt (pull_request) Successful in 3s
CI / install.sh client upgrade (pull_request) Successful in 8s
CI / cargo deny (pull_request) Successful in 19s
CI / cargo deny advisories (pull_request) Successful in 29s
CI / repository boundary (pull_request) Successful in 6s
CI / cargo clippy (pull_request) Successful in 1m31s
CI / frontend-web (pull_request) Successful in 1m15s
CI / cargo test (pull_request) Successful in 3m59s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
2ae65e51bc
vivy approved these changes 2026-11-15 21:45:08 +00:00
Dismissed
vivy left a comment

Correct and configurable (env > [display] > default 3, 0 = never). Non-blocking: watch_cursor runs before the window is shown, so gtksink/WebKit child gdk windows that are not realized yet are not in the list; GDK3 children with no cursor inherit the toplevel's, so it still works unless WebKit sets its own cursor. Worth one check on a real kiosk with a web item.

Correct and configurable (env > [display] > default 3, 0 = never). Non-blocking: watch_cursor runs before the window is shown, so gtksink/WebKit child gdk windows that are not realized yet are not in the list; GDK3 children with no cursor inherit the toplevel's, so it still works unless WebKit sets its own cursor. Worth one check on a real kiosk with a web item.
vivy approved these changes 2026-11-15 21:47:43 +00:00
Dismissed
vivy left a comment

Approved. CI is green on 2ae65e51.

What I checked:

  • Window::build() calls show_all() before watch_cursor, so the toplevel and the stack children are realized and widget.window() returns a gdk::Window. The list of windows is not empty.
  • The wait comes from config with an env override, and 0 means never. This follows GRI-1884.
  • The decision logic is pure and tested. The GTK wiring is tested against a real gdk::Window.

One thing to watch, not a blocker: WebKit sets its own cursor on its window when the pointer is over a link or text. If a page changes the cursor while the pointer is hidden and not moving, the pointer can come back until the next tick that is not a no-op. tick() returns early once hidden is true, so it will not hide it again until there is movement. If you see that on a real screen, re-applying the blank cursor in tick() while hidden is the fix.

I merge it after #251, #256, #257 and #258, one per CI cycle.

Approved. CI is green on 2ae65e51. What I checked: - `Window::build()` calls `show_all()` before `watch_cursor`, so the toplevel and the stack children are realized and `widget.window()` returns a `gdk::Window`. The list of windows is not empty. - The wait comes from config with an env override, and `0` means never. This follows GRI-1884. - The decision logic is pure and tested. The GTK wiring is tested against a real `gdk::Window`. One thing to watch, not a blocker: WebKit sets its own cursor on its window when the pointer is over a link or text. If a page changes the cursor while the pointer is hidden and not moving, the pointer can come back until the next tick that is not a no-op. `tick()` returns early once `hidden` is true, so it will not hide it again until there is movement. If you see that on a real screen, re-applying the blank cursor in `tick()` while hidden is the fix. I merge it after #251, #256, #257 and #258, one per CI cycle.
Merge branch 'dev' into fix/GRI-2112-hide-idle-cursor
All checks were successful
CI / the pre-push hook (pull_request) Successful in 3s
CI / cargo fmt (pull_request) Successful in 4s
CI / install.sh client upgrade (pull_request) Successful in 8s
CI / cargo deny (pull_request) Successful in 22s
CI / cargo deny advisories (pull_request) Successful in 21s
CI / repository boundary (pull_request) Successful in 4s
CI / cargo clippy (pull_request) Successful in 1m37s
CI / frontend-web (pull_request) Successful in 1m6s
CI / cargo test (pull_request) Successful in 2m42s
CI / Notify gate failed (pull_request) Has been skipped
CI / CI (pull_request) Successful in 1s
8e6d761f8c
vivy dismissed vivy's review 2026-11-15 22:55:15 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

vivy merged commit 881596861b into dev 2026-11-15 23:11:00 +00:00
vivy deleted branch fix/GRI-2112-hide-idle-cursor 2026-11-15 23:11:01 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Grimoirix/grimoire-of-digital-signage!259
No description provided.