]> Pileus Git - ~andy/gtk/commitdiff
Set current cursor also when changing the cursor of a window that is the
authorTor Lillqvist <tlillqvist@novell.com>
Sun, 9 Jan 2005 19:26:25 +0000 (19:26 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 9 Jan 2005 19:26:25 +0000 (19:26 +0000)
2005-01-09  Tor Lillqvist  <tlillqvist@novell.com>

* gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Set current
cursor also when changing the cursor of a window that is the first
ancestor of the window containing the pointer that has a cursor
defined. (#163035, Ivan Wong)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/win32/gdkwindow-win32.c

index 28e6eac39a771d328fc589723041c3d9fe899e6a..d0dd954630298a192edfc5343978daae23d825d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-09  Tor Lillqvist  <tlillqvist@novell.com>
+
+       * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Set current
+       cursor also when changing the cursor of a window that is the first
+       ancestor of the window containing the pointer that has a cursor
+       defined. (#163035, Ivan Wong)
+
 2005-01-09  Anders Carlsson <andersca@gnome.org>
 
        * gtk/gtkcellrenderertext.c: (get_size):
index 28e6eac39a771d328fc589723041c3d9fe899e6a..d0dd954630298a192edfc5343978daae23d825d3 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-09  Tor Lillqvist  <tlillqvist@novell.com>
+
+       * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Set current
+       cursor also when changing the cursor of a window that is the first
+       ancestor of the window containing the pointer that has a cursor
+       defined. (#163035, Ivan Wong)
+
 2005-01-09  Anders Carlsson <andersca@gnome.org>
 
        * gtk/gtkcellrenderertext.c: (get_size):
index 28e6eac39a771d328fc589723041c3d9fe899e6a..d0dd954630298a192edfc5343978daae23d825d3 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-09  Tor Lillqvist  <tlillqvist@novell.com>
+
+       * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Set current
+       cursor also when changing the cursor of a window that is the first
+       ancestor of the window containing the pointer that has a cursor
+       defined. (#163035, Ivan Wong)
+
 2005-01-09  Anders Carlsson <andersca@gnome.org>
 
        * gtk/gtkcellrenderertext.c: (get_size):
index 28e6eac39a771d328fc589723041c3d9fe899e6a..d0dd954630298a192edfc5343978daae23d825d3 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-09  Tor Lillqvist  <tlillqvist@novell.com>
+
+       * gdk/win32/gdkwindow-win32.c (gdk_window_set_cursor): Set current
+       cursor also when changing the cursor of a window that is the first
+       ancestor of the window containing the pointer that has a cursor
+       defined. (#163035, Ivan Wong)
+
 2005-01-09  Anders Carlsson <andersca@gnome.org>
 
        * gtk/gtkcellrenderertext.c: (get_size):
index 99a2e02bed53c5b8ab603d22556a57b82ffa4dac..bb7502ac728d171d7063d2f911c33f37260ae256 100644 (file)
@@ -1823,10 +1823,31 @@ gdk_window_set_cursor (GdkWindow *window,
                               hcursor, impl->hcursor));
     }
 
-  /* If the pointer is over our window, set new cursor if given */
-  if (gdk_window_get_pointer(window, NULL, NULL, NULL) == window)
-    if (impl->hcursor != NULL)
-      SetCursor (impl->hcursor);
+  if (impl->hcursor != NULL)
+    {
+      /* If the pointer is over our window, set new cursor */
+      GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL);
+      if (curr_window == window)
+        SetCursor (impl->hcursor);
+      else
+       {
+         /* Climb up the tree and find whether our window is the
+          * first ancestor that has cursor defined, and if so, set
+          * new cursor.
+          */
+         GdkWindowObject *curr_window_obj = GDK_WINDOW_OBJECT (curr_window);
+         while (curr_window_obj &&
+                !GDK_WINDOW_IMPL_WIN32 (curr_window_obj->impl)->hcursor)
+           {
+             curr_window_obj = curr_window_obj->parent;
+             if (curr_window_obj == GDK_WINDOW_OBJECT (window))
+               {
+                 SetCursor (impl->hcursor);
+                 break;
+               }
+           }
+       }
+    }
 
   /* Destroy the previous cursor: Need to make sure it's no longer in
    * use before we destroy it, in case we're not over our window but