]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed global cursor setting on Mac, which fixes busy cursor and context help cursor
authorJulian Smart <julian@anthemion.co.uk>
Tue, 29 Jan 2008 11:02:47 +0000 (11:02 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 29 Jan 2008 11:02:47 +0000 (11:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cshelp.cpp
src/mac/carbon/cursor.cpp
src/mac/carbon/toplevel.cpp
src/mac/carbon/utils.cpp

index c24b709e988037a0eb7d60410fff47c05baa0d11..cfce45d48d2c1620adb176a4eb6ac4c1b8558a81 100644 (file)
@@ -123,8 +123,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
     wxCursor oldCursor = win->GetCursor();
     win->SetCursor(cursor);
 
-#ifdef __WXMSW__
-    //    wxSetCursor(cursor);
+#ifdef __WXMAC__
+    wxSetCursor(cursor);
 #endif
 
     m_status = false;
@@ -149,6 +149,10 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
 
     win->SetCursor(oldCursor);
 
+#ifdef __WXMAC__
+    wxSetCursor(wxNullCursor);
+#endif
+
     if (m_status)
     {
         wxPoint pt;
index 0b8e4c8a7bdee177e78d832678ee0a08a7bc0aab..c48663d7fd1a2b51dfea0eb88259ccb3d10a67d5 100644 (file)
@@ -689,7 +689,9 @@ wxCursor::~wxCursor()
 }
 
 // Global cursor setting
+wxCursor gGlobalCursor;
 void wxSetCursor(const wxCursor& cursor)
 {
     cursor.MacInstall() ;
+    gGlobalCursor = cursor;
 }
index 7e90437c5654b348c08df59f64d16392d8794c13..99d2784deccb9628c78a2163d7774f096ed280c3 100644 (file)
@@ -563,11 +563,16 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
         wxWindow* cursorTarget = currentMouseWindow ;
         wxPoint cursorPoint( wxevent.m_x , wxevent.m_y ) ;
 
-        while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
+        extern wxCursor gGlobalCursor;
+
+        if (!gGlobalCursor.IsOk())
         {
-            cursorTarget = cursorTarget->GetParent() ;
-            if ( cursorTarget )
-                cursorPoint += cursorTarget->GetPosition();
+            while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) )
+            {
+                cursorTarget = cursorTarget->GetParent() ;
+                if ( cursorTarget )
+                    cursorPoint += cursorTarget->GetPosition();
+            }
         }
 
     }
index 7c8de25d0bb2a8de7cbb621a04878ed9eed7007b..ed23889918ab912e4720d5ed621ea717e37f2c34 100644 (file)
@@ -126,6 +126,8 @@ void wxBeginBusyCursor(const wxCursor *cursor)
     {
         gMacStoredActiveCursor = gMacCurrentCursor;
         cursor->MacInstall();
+
+        wxSetCursor(*cursor);
     }
     //else: nothing to do, already set
 }
@@ -140,6 +142,8 @@ void wxEndBusyCursor()
     {
         gMacStoredActiveCursor.MacInstall();
         gMacStoredActiveCursor = wxNullCursor;
+
+        wxSetCursor(wxNullCursor);
     }
 }