fix(desktop): scale HiDPI pointer coords into logical space (VA-111) #119
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-111-hidpi-pointer-scale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Absolute pointer positioning on the Desktop tab was off by the display-scale factor (2x on a scale=2 HiDPI output, desktop-02). The SPA sends pointer coordinates in the captured frame's physical pixel space (grim), but the Wayland input paths inject in the compositor's logical coordinate space, so every move travelled twice as far. This divides the incoming coordinate down to logical space before injection, keeping the agent authoritative over the input coordinate space. scale=1 sessions are bit-for-bit unchanged.
How
move_absnow takes the display scale and divides the frame-pixel coordinate by it (to_logical_coord) before computing the relative delta, instead of ignoring its old width/height args (VA-111 AC4).pointer_motion_absolute_from_framemaps the frame-pixel coordinate into the ScreenCast stream's own coordinate space viaStream::size()(map_frame_coord), rather than passing raw tab pixels toNotifyPointerMotionAbsolute(VA-111 AC3).resolve_pointer_scale, preference order): the SPA reports the compositor's logical desktop size via a new inbound command (cmd 90), the authoritative compositor-agnostic source; absent that, the wlroots-onlywlr-randrScale:value (primary_output_scale/parse_wlr_randr_scale); absent both, scale collapses to 1.0. Regression-safe by construction.Decisions (confirmed with maintainer)
Tests
Pure transforms carry unit tests covering scale 1.0 identity, 2.0 halving, and fractional 1.5 rounding:
to_logical_coord,map_frame_coord,parse_wlr_randr_scale,resolve_pointer_scale. Fulljust check(clippy + fmt + test) green, pluscargo clippy --features vervain-agent-kvm/wayland-portalto cover the feature-gated portal path that the default gate skips.Follow-ups (filed + linked)
kvm_input_mouse_moveaction and the native VNC pointer path both hardcode the X11 XTEST backend and need the same session-based routing + scaling. Found in the completeness sweep.Not covered here
Live cursor-coincidence validation on scale=1 / scale=2 / multi-monitor HiDPI hardware (VA-111 AC1/AC2/AC4 "Validate ...") is manual QA the CI sandbox cannot perform (no Wayland, no /dev/uinput, no HiDPI display).