X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1b806b98241ab649c169aaa1f134df85e80fb8b..8a31648287be0ef976f133de2786b137f1e98340:/src/gtk/cursor.cpp diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 525bccdb7e..615677e506 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -390,20 +390,15 @@ const wxCursor wxBusyCursor::GetBusyCursor() return wxCursor(wxCURSOR_WATCH); } -static void UpdateCursors(const wxWindowList& list, GdkDisplay*& display) +static void UpdateCursors(GdkDisplay** display) { - wxWindowList::const_iterator i = list.begin(); - for (size_t n = list.size(); n--; ++i) + wxWindowList::const_iterator i = wxTopLevelWindows.begin(); + for (size_t n = wxTopLevelWindows.size(); n--; ++i) { wxWindow* win = *i; - if (display == NULL && win->m_widget) - { - GdkWindow* w = gtk_widget_get_window(win->m_widget); - if (w) - display = gdk_drawable_get_display(w); - } - win->GTKUpdateCursor(true, false); - UpdateCursors(win->GetChildren(), display); + win->GTKUpdateCursor(); + if (display && *display == NULL && win->m_widget) + *display = gtk_widget_get_display(win->m_widget); } } @@ -414,8 +409,7 @@ void wxEndBusyCursor() g_globalCursor = gs_savedCursor; gs_savedCursor = wxNullCursor; - GdkDisplay* unused = NULL; - UpdateCursors(wxTopLevelWindows, unused); + UpdateCursors(NULL); } void wxBeginBusyCursor(const wxCursor* cursor) @@ -429,7 +423,7 @@ void wxBeginBusyCursor(const wxCursor* cursor) gs_savedCursor = g_globalCursor; g_globalCursor = *cursor; GdkDisplay* display = NULL; - UpdateCursors(wxTopLevelWindows, display); + UpdateCursors(&display); if (display) gdk_display_flush(display); } @@ -442,6 +436,5 @@ bool wxIsBusy() void wxSetCursor( const wxCursor& cursor ) { g_globalCursor = cursor; - GdkDisplay* unused = NULL; - UpdateCursors(wxTopLevelWindows, unused); + UpdateCursors(NULL); }