]> Pileus Git - ~andy/gtk/commitdiff
Don't compress motion events for different devices
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 14 Feb 2013 19:51:33 +0000 (14:51 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 14 Feb 2013 22:19:53 +0000 (17:19 -0500)
A switch of device may be significant for an application, so don't
compress motion events if they are for different devices. This simple
handling isn't sufficient if we have competing event streams from
two different pointer events, but we don't expect this case to be
common.

gdk/gdkevents.c

index 8e05a8edcde71972265144bf81b16826f0a0fe88..4a9d0b965a0e73543985559673c3ea7ac9c9ff9f 100644 (file)
@@ -268,6 +268,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
   GList *tmp_list;
   GList *pending_motions = NULL;
   GdkWindow *pending_motion_window = NULL;
+  GdkDevice *pending_motion_device = NULL;
 
   /* If the last N events in the event queue are motion notify
    * events for the same window, drop all but the last */
@@ -288,7 +289,12 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
           pending_motion_window != event->event.motion.window)
         break;
 
+      if (pending_motion_device != NULL &&
+          pending_motion_device != event->event.motion.device)
+        break;
+
       pending_motion_window = event->event.motion.window;
+      pending_motion_device = event->event.motion.device;
       pending_motions = tmp_list;
 
       tmp_list = tmp_list->prev;