Skip to content

backends/x11: Deliver accumulated smooth scroll events through XTest - #875

Open
radkawar wants to merge 1 commit into
linuxmint:masterfrom
radkawar:fix/x11-smooth-scroll
Open

radkawar wants to merge 1 commit into
linuxmint:masterfrom
radkawar:fix/x11-smooth-scroll

Conversation

@radkawar

@radkawar radkawar commented Oct 15, 2026 •

Copy link
Copy Markdown

Backport Mutter's existing X11 smooth-scroll implementation (a5d69258), preserving Pascal Nowack's authorship. The current virtual-device method is empty, so continuous scroll events are silently lost. Accumulate the deltas into the discrete wheel events XTest can deliver. This does not change the distribution's remote desktop build option.

Native test: Linux Mint 22.3 Cinnamon X11, golden KVM guest admitted through the lab FIFO. Applied the same change to Muffin 6.6.3 and built its normal Debian packages with the existing remote desktop option enabled. In a locally consented public RemoteDesktop/ScreenCast session, NotifyPointerAxisDiscrete(0, 1) and NotifyPointerAxis(0, 12) each delivered a real GTK down-scroll event to the witness window. The test also decoded real PipeWire frames and verified input rejection and held-key/button release after session closure.

Also checked current development master 17c958413753feafdbd5d58dc1e420f72a5f1859, not just the shipped Mint version. Built it normally in the golden VM, then used its matching library/GIR and the normal Clutter seat factory on an isolated authenticated Xvfb display. A continuous delta (0, 12) produced zero real X ButtonPress events on master and one with the focused PR implementation. This bug is still present on current master.

The native public-portal test client is in the fork-only Xapp implementation. It requires actual local consent rather than a private compositor bypass.

AI disclosure: AI-assisted development and native-test orchestration. The original upstream source fix and author are preserved, and the native test above was executed.

MetaVirtualInputDeviceX11 currently doesn't handle smooth scroll events
at all.
So, if a user of the remote desktop API uses smooth scroll events, then
only the wayland backend handles these events.
The user of the remote desktop API however, might not know which
backend is being used and actually the user should not even have to
care about it.

Actual smooth events cannot be emulated in the X11 events.
What can be done however is accumulating smooth events and then when
the accumulated steps surpass the DISCRETE_SCROLL_STEP value, emit a
discrete scroll event.
So, do exactly that, to make smooth scroll events work when the remote
desktop API is used with the x11 backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1727>
(cherry picked from commit a5d692582dbd29fa39a01350f416997db2d495c9)
Signed-off-by: radkawar <[email protected]>
(cherry picked from commit 3ff5a15)
Signed-off-by: radkawar <[email protected]>
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.

2 participants