[gtk+/gtk-3-8] xi2: Reset scroll valuators on synthesized crossing events
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] xi2: Reset scroll valuators on synthesized crossing events
- Date: Mon, 15 Apr 2013 09:02:17 +0000 (UTC)
commit 8e56a8097230c006832cbc195fd56c87884ac7ab
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Mar 28 14:57:00 2013 +0100
xi2: Reset scroll valuators on synthesized crossing events
On crossing events resulting from moving windows (eg. workspace switch),
deviceid equals sourceid, so make those reset scroll valuators on all
slave devices to avoid misleading jumps in scroll events
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=690275
gdk/x11/gdkdevicemanager-xi2.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 660d0f0..db2ba28 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1555,7 +1555,20 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
source_device = g_hash_table_lookup (device_manager->id_table,
GUINT_TO_POINTER (xev->sourceid));
gdk_event_set_source_device (event, source_device);
- _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
+
+ if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_MASTER)
+ _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
+ else
+ {
+ GList *slaves, *l;
+
+ slaves = gdk_device_list_slave_devices (source_device);
+
+ for (l = slaves; l; l = l->next)
+ _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
+
+ g_list_free (slaves);
+ }
event->crossing.mode = translate_crossing_mode (xev->mode);
event->crossing.detail = translate_notify_type (xev->detail);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]