]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/utils_osx.cpp
'Set to Unspecified' -> 'Set Value to Unspecified'
[wxWidgets.git] / src / osx / utils_osx.cpp
index 1081852ae7829e4931dabeb3fcc71196ddf5aec4..20d791b1a7373967f6af31d6d7f1c1f2873d062d 100644 (file)
 #endif
 
 #include "wx/osx/private.h"
-
-#if wxOSX_USE_COCOA
-// to get the theming APIs
-#include <Carbon/Carbon.h>
-#endif
-
 #include "wx/osx/private/timer.h"
 
 #include "wx/evtloop.h"
@@ -160,9 +154,31 @@ wxEventLoopBase* wxGUIAppTraits::CreateEventLoop()
     return new wxEventLoop;
 }
 
+wxNonOwnedWindow *wxFindWindowFromWXWindow(WXWindow inWindowRef);
+wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt);
+
 wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
 {
-    return wxGenericFindWindowAtPoint(pt);
+#if wxOSX_USE_CARBON
+
+    Point screenPoint = { pt.y , pt.x };
+    WindowRef windowRef;
+
+    if ( FindWindow( screenPoint , &windowRef ) )
+    {
+        wxNonOwnedWindow *nonOwned = wxFindWindowFromWXWindow( windowRef );
+
+        if ( nonOwned )
+            return wxFindWindowAtPoint( nonOwned , pt );
+    }
+
+    return NULL;
+
+#else
+
+    return wxGenericFindWindowAtPoint( pt );
+
+#endif
 }
 
 /*