[gtk+/client-side-windows: 214/284] enable motion hints - use last sent request



commit 7776c87f3f6a1c521646f825e82f8990215b35e9
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Feb 2 16:37:10 2009 +0100

    enable motion hints - use last sent request
    
    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 |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index d3cb845..ae9c8f9 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -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;
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]