]> git.saurik.com Git - wxWidgets.git/commitdiff
new capture handling, can be turned off
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 25 Jul 2005 14:27:56 +0000 (14:27 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 25 Jul 2005 14:27:56 +0000 (14:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp

index f1308198d4cbb2f03c6d3c76bc5f6a191144451a..735fd048ee2d20f9be09a5c27ab811d866940930 100644 (file)
@@ -49,7 +49,9 @@
     #include "wx/sysopt.h"
 #endif
 
+#ifndef __DARWIN__
 #include <ToolUtils.h>
+#endif
 
 //For targeting OSX
 #include "wx/mac/private.h"
@@ -447,6 +449,9 @@ ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , Poi
     return wxMacFindSubControl( toplevelWindow , location , rootControl , outPart ) ;
 
 }
+
+#define NEW_CAPTURE_HANDLING 1
+
 pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
 {
     wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ;
@@ -464,11 +469,22 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
     wxWindow* currentMouseWindow = NULL ;
     ControlRef control = NULL ;
 
+#if NEW_CAPTURE_HANDLING
+    if ( wxApp::s_captureWindow )
+    {
+        window = (WindowRef) wxApp::s_captureWindow->MacGetTopLevelWindowRef() ;
+    }
+#endif
+    
     if ( window )
     {
         QDGlobalToLocalPoint( UMAGetWindowPort(window ) ,  &windowMouseLocation ) ;
 
-        if ( wxApp::s_captureWindow && wxApp::s_captureWindow->MacGetTopLevelWindowRef() == (WXWindow) window && windowPart == inContent )
+        if ( wxApp::s_captureWindow
+#if !NEW_CAPTURE_HANDLING
+             && wxApp::s_captureWindow->MacGetTopLevelWindowRef() == (WXWindow) window && windowPart == inContent
+#endif
+             )
         {
             currentMouseWindow = wxApp::s_captureWindow ;
         }
@@ -1556,7 +1572,10 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
     {
         wxSize sz = GetClientSize();
         wxRegion rgn(0, 0, sz.x, sz.y);
-        return SetShape(rgn);
+        if ( rgn.IsEmpty() )
+            return false ;
+        else
+            return SetShape(rgn);
     }
 
     // Make a copy of the region