Skip to content

feat(linux/input): optional absolute mouse as relative motion - #5529

Open
danalec wants to merge 1 commit into
LizardByte:masterfrom
danalec:pr/abs-mouse-relative
Open

feat(linux/input): optional absolute mouse as relative motion#5529
danalec wants to merge 1 commit into
LizardByte:masterfrom
danalec:pr/abs-mouse-relative

Conversation

@danalec

@danalec danalec commented Aug 19, 2026

Copy link
Copy Markdown

Description

Moonlight TV clients (and other absolute-motion sources) send absolute mouse
positions. The Linux backend forwards them as absolute uinput events, which
compositors treat as absolute pointer motion.

COSMIC's magnifier does not track the cursor on absolute motion:
PointerMotionAbsolute moves the cursor but never calls update_focal_point
(pop-os/cosmic-comp#2760; same symptom class as #1418/VirtualBox). Relative
motion updates the zoom on every event.

This adds an absolute_mouse_as_relative option (disabled by default) that
converts absolute client coordinates into relative deltas:

  • The first absolute event still places the cursor absolutely, anchoring the
    baseline.
  • Subsequent events are emitted as relative deltas (dead reckoning), so the
    cursor arrives at the compositor as relative pointer motion.
  • The KMS capture path publishes the cursor-plane position every frame; the
    internal estimate snaps to it while the client is idle, and a coordinate
    saturated at the client's own surface edge targets the matching host edge,
    so movement cannot stall mid-screen. On backends without cursor feedback
    the conversion works from dead reckoning alone.

Documented in docs/configuration.md.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • Moderate: AI helped with code generation or debugging specific parts

@danalec danalec changed the title linux: emulate relative mouse movement from absolute coordinates fix(linux/input): emulate relative mouse movement from absolute coordinates Aug 19, 2026
@ReenigneArcher

ReenigneArcher commented Aug 19, 2026

Copy link
Copy Markdown
Member

@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

@ReenigneArcher ReenigneArcher added the ai PR has signs of heavy ai usage (either indicated by user or assumed) label Aug 19, 2026
@danalec
danalec force-pushed the pr/abs-mouse-relative branch from 7fc91f8 to 25164e4 Compare August 21, 2026 01:10
@Kishi85

Kishi85 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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.

@danalec
danalec force-pushed the pr/abs-mouse-relative branch 2 times, most recently from 639fe89 to 822ee0e Compare August 26, 2026 03:02
@danalec danalec changed the title fix(linux/input): emulate relative mouse movement from absolute coordinates feat(linux/input): optional absolute mouse as relative motion Aug 26, 2026
@danalec
danalec force-pushed the pr/abs-mouse-relative branch 4 times, most recently from 808857e to c4bbe39 Compare August 26, 2026 04:48
Some compositors implement assistive features that only track relative
pointer motion; Wayland's PointerMotionAbsolute moves the cursor but such
features do not follow it (e.g. the COSMIC screen magnifier focal point,
pop-os/cosmic-comp#2760). Add an absolute_mouse_as_relative option
(disabled by default) that converts absolute client coordinates into
relative deltas.

The first absolute event still anchors the cursor absolutely. Subsequent
events are turned into relative deltas driven by dead reckoning. The KMS
capture path publishes the real cursor-plane position every frame; the
estimate snaps to it while the client is idle, and a coordinate saturated
at the client's own surface edge targets the matching host edge so
movement cannot stall mid-screen. On backends without cursor feedback
the conversion still works from dead reckoning alone.
@danalec
danalec force-pushed the pr/abs-mouse-relative branch from c4bbe39 to 5787155 Compare August 27, 2026 18:09
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai PR has signs of heavy ai usage (either indicated by user or assumed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants