]> git.saurik.com Git - wxWidgets.git/commitdiff
Patch update, probably fixes #12090: wxGTK cursor handling revamp
authorRobert Roebling <robert@roebling.de>
Sun, 30 May 2010 20:01:36 +0000 (20:01 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 30 May 2010 20:01:36 +0000 (20:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 2f9a0edfe45ceed64c5c3cc8ff73d2d6a763e723..a23f303794bab06550e0d54efb74d5d733ef8ce7 100644 (file)
@@ -1845,6 +1845,8 @@ gtk_window_realized_callback(GtkWidget* widget, wxWindow* win)
     wxWindowCreateEvent event( win );
     event.SetEventObject( win );
     win->GTKProcessEvent( event );
+
+    win->GTKUpdateCursor(true, false);
 }
 
 //-----------------------------------------------------------------------------
@@ -3402,37 +3404,22 @@ void wxWindowGTK::GTKUpdateCursor(bool update_self /*=true*/, bool recurse /*=tr
         wxCursor cursor(g_globalCursor.Ok() ? g_globalCursor : GetCursor());
         if ( cursor.Ok() )
         {
-            if (m_wxwindow && (m_wxwindow != m_widget))
+            wxArrayGdkWindows windowsThis;
+            GdkWindow* window = GTKGetWindow(windowsThis);
+            if (window)
+                gdk_window_set_cursor( window, cursor.GetCursor() );
+            else
             {
-                wxArrayGdkWindows windowsThis;
-                GdkWindow* window = GTKGetDrawingWindow();
-                if (window)
-                    gdk_window_set_cursor( window, cursor.GetCursor() );
-                else
+                const size_t count = windowsThis.size();
+                for ( size_t n = 0; n < count; n++ )
                 {
-                    const size_t count = windowsThis.size();
-                    for ( size_t n = 0; n < count; n++ )
+                    GdkWindow *win = windowsThis[n];
+                    // It can be zero if the window has not been realized yet.
+                    if ( win )
                     {
-                        GdkWindow *win = windowsThis[n];
-                        if ( !win )
-                        {
-                            wxFAIL_MSG(wxT("NULL window returned by GTKGetWindow()?"));
-                            continue;
-                        }
                         gdk_window_set_cursor(win, cursor.GetCursor());
                     }
                 }
-
-                window = m_widget->window;
-                if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget)))
-                    gdk_window_set_cursor( window, cursor.GetCursor() );
-
-            }
-            else if ( m_widget )
-            {
-                GdkWindow *window = m_widget->window;
-                if ( window && !GTK_WIDGET_NO_WINDOW(m_widget) )
-                    gdk_window_set_cursor( window, cursor.GetCursor() );
             }
         }
     }