From 3c393c0a564ec9197b8441d9c106f46509c99729 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 25 Jul 2005 14:27:56 +0000 Subject: [PATCH] new capture handling, can be turned off git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/toplevel.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index f1308198d4..735fd048ee 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -49,7 +49,9 @@ #include "wx/sysopt.h" #endif +#ifndef __DARWIN__ #include +#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 -- 2.45.2