From: Carlos Garnacho Date: Sat, 4 Feb 2023 12:10:42 +0000 (+0100) Subject: gdk/x11: Reset all scroll valuators on enter X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~8^2~2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=824e983372d939693f7eba5c394e647a9035a0f8;p=gtk4.git 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. Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4160 --- diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 4f3d69fc83..46f2f048f9 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -2066,19 +2066,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