]> Pileus Git - ~andy/gtk/commitdiff
enable motion hints - use last sent request
authorAlexander Larsson <alexl@redhat.com>
Mon, 2 Feb 2009 15:37:10 +0000 (16:37 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:30 +0000 (10:15 +0200)
We were using the next request, but there is no guarantee
on is sent. This caused trouble in e.g. the handlebox dragging.

gdk/gdkdisplay.c

index d3cb8455ab87e1cfb36d6f58c282eb9617ad896e..ae9c8f92dca1d04f5d982ed3239a3111efed4954 100644 (file)
@@ -447,13 +447,19 @@ _gdk_get_sm_client_id (void)
 void
 _gdk_display_enable_motion_hints (GdkDisplay *display)
 {
-  gulong next_serial;
+  gulong serial;
   
   if (display->pointer_info.motion_hint_serial != 0)
     {
-      next_serial = _gdk_windowing_window_get_next_serial (display);
-      if (next_serial < display->pointer_info.motion_hint_serial)
-       display->pointer_info.motion_hint_serial = next_serial;
+      serial = _gdk_windowing_window_get_next_serial (display);
+      /* We might not actually generate the next request, so
+        make sure this triggers always, this may cause it to
+        trigger slightly to early, but this is just a hint
+        anyway. */
+      if (serial > 0)
+       serial--;
+      if (serial < display->pointer_info.motion_hint_serial)
+       display->pointer_info.motion_hint_serial = serial;
     }
 }