[GTK4] EventControllerScroll: Doesn't drop first junk scroll event on X11 after switching windows
Steps to reproduce
All steps require a mouse wheel other other discrete scrolling device.
- Open a window with an attached
EventControllerScroll
. - Scroll in the first window (this seems to be necessary to "initialize" it in some way).
- Using a discrete device, scroll in another window, preferably many times in one direction.
- Return to the first window and scroll once again. Preferably once in the opposite direction to step 3. Observe one extremely "large" discrete event that is the sum of all the scrolling actions on the other window and the final event on this one.
Current behavior
All of the discrete events on the other window/widget are added together in one single large event. This event can even be in the opposite direction of what the user intended on the original window.
The user may scroll down 5 times on the other window and up once on the first window, but the event sent by the controller on the first window is as if they scrolled down 4 times at once on the first window.
Expected outcome
Scrolling on other windows/widgets should have no effect on the events emitted by EventControllerScroll
. They should certainly not be saved up and all emitted together as one sum event.
Version information
Fedora 34, GTK 4.2.1. WM: x11/i3
Additional information
I noticed this bug in several GTK applications, over a long period of time (multiple years), but it was a rare intermittent issue I couldn't explain or reproduce. It manifested in those applications as, sometimes, scrolling in the opposite direction from what I intended after interacting with other applications, or scrolling by unexpectedly large amounts. I only figured it out when inspecting the events while looking into #4159 Edit: it was evidently not the same issue as this precise bug doesn't reproduce in GTK3, making this a regression in GTK4