]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/cursor.cpp
progress message passed to wxDC::StartDoc() is not appropriate for PostScript documen...
[wxWidgets.git] / src / gtk / cursor.cpp
index c8e710bc96bcd5d04cb03c23ce8e06d62b2ef5e9..8e9c50a44e410e7634233c56e7d3ee1aca06b1cb 100644 (file)
 #include "wx/cursor.h"
 
 #ifndef WX_PRECOMP
+    #include "wx/window.h"
     #include "wx/app.h"
-    #include "wx/utils.h"
     #include "wx/image.h"
-    #include "wx/colour.h"
     #include "wx/bitmap.h"
 #endif // WX_PRECOMP
 
@@ -82,7 +81,7 @@ wxCursor::wxCursor( int cursorId )
         case wxCURSOR_ARROW:            // fall through to default
         case wxCURSOR_DEFAULT:          gdk_cur = GDK_LEFT_PTR; break;
         case wxCURSOR_RIGHT_ARROW:      gdk_cur = GDK_RIGHT_PTR; break;
-        case wxCURSOR_HAND:             gdk_cur = GDK_HAND1; break;
+        case wxCURSOR_HAND:             gdk_cur = GDK_HAND2; break;
         case wxCURSOR_CROSS:            gdk_cur = GDK_CROSSHAIR; break;
         case wxCURSOR_SIZEWE:           gdk_cur = GDK_SB_H_DOUBLE_ARROW; break;
         case wxCURSOR_SIZENS:           gdk_cur = GDK_SB_V_DOUBLE_ARROW; break;
@@ -345,19 +344,31 @@ const wxCursor wxBusyCursor::GetBusyCursor()
     return wxCursor(wxCURSOR_WATCH);
 }
 
+static void InternalIdle(const wxWindowList& list, GdkDisplay*& display)
+{
+    wxWindowList::const_iterator i = list.begin();
+    for (size_t n = list.size(); n--; ++i)
+    {
+        wxWindow* win = *i;
+        if (display == NULL && win->m_widget && win->m_widget->window)
+            display = gdk_drawable_get_display(win->m_widget->window);
+        win->OnInternalIdle();
+        InternalIdle(win->GetChildren(), display);
+    }
+}
+
 void wxEndBusyCursor()
 {
     if (--gs_busyCount > 0)
         return;
 
-    wxSetCursor( gs_savedCursor );
+    g_globalCursor = gs_savedCursor;
     gs_savedCursor = wxNullCursor;
-
-    if (wxTheApp)
-        wxTheApp->ProcessIdle();
+    GdkDisplay* unused = NULL;
+    InternalIdle(wxTopLevelWindows, unused);
 }
 
-void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) )
+void wxBeginBusyCursor(const wxCursor* cursor)
 {
     if (gs_busyCount++ > 0)
         return;
@@ -366,13 +377,11 @@ void wxBeginBusyCursor( const wxCursor *WXUNUSED(cursor) )
                   wxT("forgot to call wxEndBusyCursor, will leak memory") );
 
     gs_savedCursor = g_globalCursor;
-
-    wxSetCursor( wxCursor(wxCURSOR_WATCH) );
-
-    if (wxTheApp)
-        wxTheApp->ProcessIdle();
-
-    gdk_flush();
+    g_globalCursor = *cursor;
+    GdkDisplay* display = NULL;
+    InternalIdle(wxTopLevelWindows, display);
+    if (display)
+        gdk_display_flush(display);
 }
 
 bool wxIsBusy()