Skip to content

backends/x11: Emit discrete scroll events for accumulated smooth events

Pascal Nowack requested to merge pnowack/mutter:x11-vInput-mouse-scroll into master

Sorry for the title of both commit messages (they are not perfect).
The problem is: anything better exceeds 72 characters.

Quoting the most relevant commit here:

backends/x11: Emit discrete scroll events for accumulated smooth events

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.

Merge request reports