fix(linux/input): emulate relative mouse movement from absolute coordinates - #5529
fix(linux/input): emulate relative mouse movement from absolute coordinates#5529danalec wants to merge 1 commit into
Conversation
|
@danalec It won't pass until I approve the workflows. Anyway... Thank you for the PR submission, but it looks like you used AI to create this PR. Please read and follow our Contributing guidelines and specifically our AI Usage policy. Additionally, please update the PR to use the correct template. You can find it at https://github.com/LizardByte/.github/blob/master/.github/pull_request_template.md?plain=1 |
Convert absolute mouse input to relative deltas, accumulating fractional deltas so slow (sub-pixel) motion still moves the cursor on both axes. Moonlight TV clients send absolute positions; emitting relative deltas makes the COSMIC magnifier follow the cursor (PointerMotionAbsolute never updates the zoom focal point — pop-os/cosmic-comp LizardByte#2760).
7fc91f8 to
25164e4
Compare
|
|
This might also fix absolute touch input on KDE in a multi-monitor scenario as that currently sends the touch events to a fixed monitor (configurable in systemsettings) instead of selecting the correct monitor by absolute coordinates. |



Summary
Moonlight TV clients (and other absolute-motion sources) send absolute mouse
positions (
MOUSE_MOVE_ABS_MAGIC). The Linux backend forwards them as absoluteuinput events, which compositors treat as absolute pointer motion.
COSMIC's magnifier does not track the cursor on absolute motion:
PointerMotionAbsolutemoves the cursor but never callsupdate_focal_point(pop-os/cosmic-comp#2760; same symptom class as #1418/VirtualBox). Relative
motion (
PointerMotion) updates the zoom on every event, so converting absoluteinput to relative deltas makes the magnifier follow the cursor.
How it works
baseline (
abs_mouse).move_mouse) based on thetracked last position, so the cursor arrives at the compositor as relative
pointer motion.
Testing
Verified on a KVM guest (CachyOS/COSMIC 1.5) streaming to a Moonlight TV client:
with the patch the magnifier follows the cursor; without it, the zoomed view
stays fixed.
Related