Add patch from 4.9.x to avoid scroll events being sent to more than one window under X11
authorSimon McVittie <smcv@debian.org>
Sat, 4 Feb 2023 15:11:38 +0000 (15:11 +0000)
committerSimon McVittie <smcv@debian.org>
Sat, 4 Feb 2023 15:13:03 +0000 (15:13 +0000)
Closes: #1029972
LP: #1993594

debian/patches/gdk-x11-Reset-all-scroll-valuators-on-enter.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/gdk-x11-Reset-all-scroll-valuators-on-enter.patch b/debian/patches/gdk-x11-Reset-all-scroll-valuators-on-enter.patch
new file mode 100644 (file)
index 0000000..948652b
--- /dev/null
@@ -0,0 +1,45 @@
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Sat, 4 Feb 2023 13:10:42 +0100
+Subject: gdk/x11: Reset all scroll valuators on enter
+
+We no longer need to make much distinction between multiple logical
+devices, plus it breaks esp. with the Xwayland input device distribution.
+Just iterate across all devices and reset their scroll valuators.
+
+Origin: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5479
+Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/4160
+Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/5202
+Bug-Debian: https://bugs.debian.org/1029972
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gtk4/+bug/1993594
+Applied-upstream: 4.9.3, commit:824e983372d939693f7eba5c394e647a9035a0f8
+---
+ gdk/x11/gdkdevicemanager-xi2.c | 15 +++------------
+ 1 file changed, 3 insertions(+), 12 deletions(-)
+
+diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
+index 02ceb2f..dd3f86c0 100644
+--- a/gdk/x11/gdkdevicemanager-xi2.c
++++ b/gdk/x11/gdkdevicemanager-xi2.c
+@@ -2064,19 +2064,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
+             xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
+             GDK_IS_TOPLEVEL (surface))
+           {
+-            if (gdk_x11_device_xi2_get_device_type ((GdkX11DeviceXI2 *) device) != GDK_X11_DEVICE_TYPE_LOGICAL)
+-              _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
+-            else
+-              {
+-                GList *physical_devices, *l;
+-
+-                physical_devices = gdk_device_list_physical_devices (source_device);
++            GList *l;
+-                for (l = physical_devices; l; l = l->next)
+-                  _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
+-
+-                g_list_free (physical_devices);
+-              }
++            for (l = device_manager->devices; l; l = l->next)
++              _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
+           }
+         event = gdk_crossing_event_new (ev->evtype == XI_Enter
index c76f469122daf7f9073251ae642d55ddab3cc9ad..f029df3c7ebd4210a78cbe9dfc07c267e1d9aa85 100644 (file)
@@ -9,6 +9,7 @@ Update-Turkish-translation-2.patch
 testsuite-Use-separate-setups-for-unstable-tests-instead-.patch
 testsuite-Don-t-create-.test-files-for-flaky-or-failing-t.patch
 node-editor-Save-test-data-relative-to-current-working-di.patch
+gdk-x11-Reset-all-scroll-valuators-on-enter.patch
 debian/reftest_compare_surfaces-Report-how-much-the-images-diffe.patch
 debian/reftests-Allow-minor-differences-to-be-tolerated.patch
 debian/Disable-inscription-markup.ui-reftest.patch