]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/cursor.cpp
guard code for mac / quickdraw
[wxWidgets.git] / src / gtk / cursor.cpp
index 56d699feb71025907baefc9ffcfd0c228ed09f68..265b98cd3b6f8266afc66e914a18d6c7ab71eaf0 100644 (file)
@@ -19,7 +19,7 @@
     #include "wx/colour.h"
 #endif // WX_PRECOMP
 
-#include "wx/gtk/private.h" //for idle stuff
+#include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
 // wxCursor
@@ -87,7 +87,7 @@ wxCursor::wxCursor( int cursorId )
         case wxCURSOR_ARROWWAIT:
         case wxCURSOR_WAIT:
         case wxCURSOR_WATCH:            gdk_cur = GDK_WATCH; break;
-        case wxCURSOR_SIZING:           gdk_cur = GDK_FLEUR; break;
+        case wxCURSOR_SIZING:           gdk_cur = GDK_SIZING; break;
         case wxCURSOR_SPRAYCAN:         gdk_cur = GDK_SPRAYCAN; break;
         case wxCURSOR_IBEAM:            gdk_cur = GDK_XTERM; break;
         case wxCURSOR_PENCIL:           gdk_cur = GDK_PENCIL; break;
@@ -178,7 +178,6 @@ wxCursor::wxCursor( const wxImage & image )
     bool bHasMask = image.HasMask();
     int imagebitcount = (w*h)/8;
 
-#if GTK_CHECK_VERSION(2,2,0)
     if ( gdk_display_supports_cursor_color(gdk_display_get_default()) )
     {
         unsigned char rMask = 0,
@@ -217,15 +216,14 @@ wxCursor::wxCursor( const wxImage & image )
 
         m_refData = new wxCursorRefData;
         M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixbuf
-                                 (
-                                  gdk_display_get_default(),
-                                  pixbuf,
-                                  hotSpotX, hotSpotY
-                                 );
+                             (
+                              gdk_display_get_default(),
+                              pixbuf,
+                              hotSpotX, hotSpotY
+                             );
         g_object_unref (pixbuf);
         return;
     }
-#endif // GTK+ 2.2+
 
     unsigned char * bits = new unsigned char [imagebitcount];
     unsigned char * maskBits = new unsigned char [imagebitcount];
@@ -376,7 +374,9 @@ GdkCursor *wxCursor::GetCursor() const
 // busy cursor routines
 //-----------------------------------------------------------------------------
 
-extern wxCursor g_globalCursor;
+/* Current cursor, in order to hang on to
+ * cursor handle when setting the cursor globally */
+wxCursor g_globalCursor;
 
 static wxCursor  gs_savedCursor;
 static int       gs_busyCount = 0;
@@ -428,8 +428,6 @@ bool wxIsBusy()
 
 void wxSetCursor( const wxCursor& cursor )
 {
-    if (g_isIdle)
-        wxapp_install_idle_handler();
-
     g_globalCursor = cursor;
+    wxTheApp->WakeUpIdle();
 }