summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-11-28 21:17:11 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2012-11-29 16:50:54 -0500
commit9614dff158f4871bf40b335e3542b7bc57802021 (patch)
treeb2bf3db7d5dfb6836442a4a22b8aae27ad2e4e7f
parent7204f51643bc9375b160e99dfa435c20ceae59d8 (diff)
downloadclutter-9614dff158f4871bf40b335e3542b7bc57802021.tar.gz
xi2: Reset the correct scroll axes on DeviceChanged
Otherwise, we'll have incorrect scrolling when we switch hardware devices without switching virtual devices. For example, on a ThinkPad, scroll using the touchpad, move the eraser mouse, and then scroll again: the deltas will be wrong. This also matches what GTK+ does. https://bugzilla.gnome.org/show_bug.cgi?id=689258
-rw-r--r--clutter/x11/clutter-device-manager-xi2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/clutter/x11/clutter-device-manager-xi2.c b/clutter/x11/clutter-device-manager-xi2.c
index 4250644fb..8ecc8ad66 100644
--- a/clutter/x11/clutter-device-manager-xi2.c
+++ b/clutter/x11/clutter-device-manager-xi2.c
@@ -733,15 +733,19 @@ clutter_device_manager_xi2_translate_event (ClutterEventTranslator *translator,
device = g_hash_table_lookup (manager_xi2->devices_by_id,
GINT_TO_POINTER (xev->deviceid));
+ source_device = g_hash_table_lookup (manager_xi2->devices_by_id,
+ GINT_TO_POINTER (xev->sourceid));
if (device)
{
_clutter_input_device_reset_axes (device);
- _clutter_input_device_reset_scroll_info (device);
translate_device_classes (backend_x11->xdpy,
device,
xev->classes,
xev->num_classes);
}
+
+ if (source_device)
+ _clutter_input_device_reset_scroll_info (device);
}
retval = CLUTTER_TRANSLATE_REMOVE;
break;