Skip to content

ALI-2649: Keep the bar and pointer hidden while the pointer rests on a video - #12

Merged
michaelaguiar merged 2 commits into
mainfrom
ali-2649-pointer-still
Dec 4, 2026
Merged

michaelaguiar merged 2 commits into
mainfrom
ali-2649-pointer-still

Conversation

@michaelaguiar

Copy link
Copy Markdown
Member

Keeps the control bar and the pointer hidden while the pointer rests over a playing video (ALI-2649).

The bug

On Hyprland, with the pointer resting over a playing video, the bar hid and then flashed back every few seconds, and the pointer never hid. Hyprland sends the pointer's position again, unmoved, when what's under it changes, such as the bar hiding or the pointer being hidden. Alias View took every pointer event as motion, so hiding the bar and pointer brought them straight back.

The fix

  • App::pointer_moved (src/app.rs) records the pointer's place and says whether it moved. While a video or song is open, a Move at the same place is dropped before it reaches the player's controls.
  • Coming back over the window (after a Leave) still counts as motion, even at the same place.
  • Pictures and the grid are unchanged.

Testing

  • New test the_pointer_coming_again_to_the_same_place_is_not_motion. It fails when pointer_moved always says "moved" (the old behaviour) and passes with the fix.
  • cargo fmt --check and the player's pointer tests pass locally. CI runs the full suite.
  • Mike tried this build on Hyprland: with the pointer resting on a playing video, the bar and the pointer both hid and stayed hidden. A move brought both back.

…a video

Hyprland sends the pointer's position again, unmoved, when what's under it
changes: the control bar hiding, or the pointer itself hiding. Alias View took
every pointer event as motion, so hiding them brought both straight back. The
bar flashed every few seconds and the pointer never hid.

A pointer event now counts as motion only when its position changed, or when
the pointer comes back over the window.
…it stays put

Review round 1:
- The pointer's "over the window" state was only kept while a video or song
  was open, so leaving over the grid or a picture was missed. Every view now
  keeps it, through one App::pointer_moved that takes the raw event.
- An unmoved event returned before the hover highlight was worked out, so a
  bar shown by a key press didn't highlight the control under a resting
  pointer. It now refreshes the hover without counting as motion.
- The test goes through the raw event, so it covers scaling and leaving.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (fresh reviewer; code-review ran) on f5b8e40. No P1 or P2 findings.

  • Fixed in dcda582: the pointer's "over the window" state was only kept while media was open. A leave over the grid or a picture was missed, so a later Enter at the same place would be dropped. Every view now keeps it, through one App::pointer_moved(&Input).
  • Fixed in dcda582: an unmoved event returned before the hover highlight was worked out. It now refreshes the hover (refresh_hover) without counting as motion.
  • Fixed in dcda582: the test only called the helper with ready-scaled numbers. It now goes through the raw Input, covering the scale and Leave. It still fails with the old "every event is motion" behaviour.
  • Declined: "Hyprland might send Leave and Enter, not Motion, when the bar hides, and then the bar would still come back." Mike's live test on Hyprland with the fix showed the bar and pointer hidden and staying hidden. If the repeat came as Leave and Enter, the bar would have come back in that test.

Confirmed by the reviewer: scale changes count as motion (fine), dropping an unmoved move during a slider drag changes nothing, and the comments match the code.

Checks on dcda582: cargo fmt --check, cargo clippy --release --all-targets -- -D warnings, and cargo test --release (132 + 6) pass.

@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 2 (fresh reviewer; code-review ran) on dcda582. Round 1's fixes hold: an unmoved move still reaching the picture view's arm is harmless (it pans by 0), refresh_hover is safe before a bar layout exists, and Leave matches the old behaviour in both paths.

  • Ticket corrected, no code change: "resting on the bar keeps it shown" was in ALI-2649's done-when, but it was never a decided behaviour. Per the 2026-12-02 decision in may_hide's doc comment and the README, the bar stays for paused, ended, music and keyboard focus. On main the bar only seemed to stay under a resting pointer because of this bug. The line is removed from the ticket. Whether a resting pointer should keep the bar is a separate question for Mike.
  • Declined: the wl.rs Enter comment ("stays hidden until the viewer shows it") is still accurate at that layer. The viewer then shows it because coming back over the window counts as motion, which the ticket asks for.
  • Declined: a scale change while the pointer rests counts as motion. That's harmless and arguably right.
  • Declined: the early return in App::input isn't covered by a test. input needs a live Wl, and the helper that decides it (pointer_moved) is tested, including against the old behaviour.

No new commits this round.

@michaelaguiar
michaelaguiar marked this pull request as ready for review December 4, 2026 03:37
@michaelaguiar
michaelaguiar merged commit 31c3983 into main Dec 4, 2026
2 checks passed
@michaelaguiar
michaelaguiar deleted the ali-2649-pointer-still branch December 4, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant