[gtk+] GdkWindow: Check device cursor first in update_cursor().



commit b2545e1732198dd00f2e21f652ab90250eb18fc1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Aug 17 15:39:03 2010 +0200

    GdkWindow: Check device cursor first in update_cursor().

 gdk/gdkwindow.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index bb2c5eb..0853375 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -8671,6 +8671,7 @@ update_cursor (GdkDisplay *display,
   GdkWindowImplIface *impl_iface;
   GdkPointerWindowInfo *pointer_info;
   GdkDeviceGrabInfo *grab;
+  GdkCursor *cursor;
 
   pointer_info = _gdk_display_get_pointer_info (display, device);
   pointer_window = pointer_info->window_under_pointer;
@@ -8699,12 +8700,16 @@ update_cursor (GdkDisplay *display,
 	 parent->window_type != GDK_WINDOW_ROOT)
     cursor_window = parent;
 
+  cursor = g_hash_table_lookup (cursor_window->device_cursor, device);
+
+  if (!cursor)
+    cursor = cursor_window->cursor;
+
   /* Set all cursors on toplevel, otherwise its tricky to keep track of
    * which native window has what cursor set. */
   toplevel = (GdkWindowObject *) get_event_toplevel (pointer_window);
   impl_iface = GDK_WINDOW_IMPL_GET_IFACE (toplevel->impl);
-  impl_iface->set_device_cursor ((GdkWindow *) toplevel, device,
-                                 cursor_window->cursor);
+  impl_iface->set_device_cursor ((GdkWindow *) toplevel, device, cursor);
 }
 
 static gboolean



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