Skip to content

fix(viewer): clamp pointer positions in letterbox margins to the display edge - #4

Open
Phaengris wants to merge 1 commit into
thelicato:mainfrom
Phaengris:fix-letterbox-pointer-clamp
Open

fix(viewer): clamp pointer positions in letterbox margins to the display edge#4
Phaengris wants to merge 1 commit into
thelicato:mainfrom
Phaengris:fix-letterbox-pointer-clamp

Conversation

@Phaengris

Copy link
Copy Markdown

Standalone bugfix off main, independent of #1/#2/#3 (the same commit also rides in #2).

The bug: pointer events landing in the letterbox margins around the guest display are dropped (widget_coords_to_guest_position returns None). Whenever the guest aspect doesn't exactly match the window — after a resolution change, or any non-matching fullscreen — pushing the host pointer against the screen edge parks it in the margin, so the guest cursor stops a few rows short of its own edge. Edge-triggered guest UI (KDE's auto-hide panel, hot corners) never fires.

The fix: clamp margin positions onto the nearest display edge instead of dropping them, matching spice-gtk. The guest cursor now pins to its edge whenever the host pointer is anywhere in the margin. Test expectations updated accordingly (margin → edge coordinate; pushed past the bottom → last guest row).

cargo fmt --check clean, cargo test --offline passes (52).

🤖 Generated with Claude Code

…lay edge

Pointer events landing in the letterbox margins around the guest display
were dropped. When the guest aspect does not exactly match the window
(e.g. after a resolution change), the host pointer parks in the margin
when pushed against the screen edge, so the guest cursor stopped a few
rows short of its own edge and edge-triggered UI — KDE's auto-hide
panel, hot corners — never fired.

Clamp margin positions onto the nearest display edge instead, matching
what spice-gtk does; the guest cursor now pins to its edge whenever the
host pointer is anywhere in the margin.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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