Patch update, probably fixes #12090: wxGTK cursor handling revamp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2010-05-30 20:01:36 +00:00
parent dec7b5a808
commit 9c76b9afa9

View File

@ -1845,6 +1845,8 @@ gtk_window_realized_callback(GtkWidget* widget, wxWindow* win)
wxWindowCreateEvent event( win ); wxWindowCreateEvent event( win );
event.SetEventObject( win ); event.SetEventObject( win );
win->GTKProcessEvent( event ); 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()); wxCursor cursor(g_globalCursor.Ok() ? g_globalCursor : GetCursor());
if ( cursor.Ok() ) 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; const size_t count = windowsThis.size();
GdkWindow* window = GTKGetDrawingWindow(); for ( size_t n = 0; n < count; n++ )
if (window)
gdk_window_set_cursor( window, cursor.GetCursor() );
else
{ {
const size_t count = windowsThis.size(); GdkWindow *win = windowsThis[n];
for ( size_t n = 0; n < count; 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()); 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() );
} }
} }
} }