new capture handling, can be turned off
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -49,7 +49,9 @@
|
|||||||
#include "wx/sysopt.h"
|
#include "wx/sysopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __DARWIN__
|
||||||
#include <ToolUtils.h>
|
#include <ToolUtils.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//For targeting OSX
|
//For targeting OSX
|
||||||
#include "wx/mac/private.h"
|
#include "wx/mac/private.h"
|
||||||
@@ -447,6 +449,9 @@ ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , Poi
|
|||||||
return wxMacFindSubControl( toplevelWindow , location , rootControl , outPart ) ;
|
return wxMacFindSubControl( toplevelWindow , location , rootControl , outPart ) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define NEW_CAPTURE_HANDLING 1
|
||||||
|
|
||||||
pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
|
pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
|
||||||
{
|
{
|
||||||
wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ;
|
wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ;
|
||||||
@@ -464,11 +469,22 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
|
|||||||
wxWindow* currentMouseWindow = NULL ;
|
wxWindow* currentMouseWindow = NULL ;
|
||||||
ControlRef control = NULL ;
|
ControlRef control = NULL ;
|
||||||
|
|
||||||
|
#if NEW_CAPTURE_HANDLING
|
||||||
|
if ( wxApp::s_captureWindow )
|
||||||
|
{
|
||||||
|
window = (WindowRef) wxApp::s_captureWindow->MacGetTopLevelWindowRef() ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( window )
|
if ( window )
|
||||||
{
|
{
|
||||||
QDGlobalToLocalPoint( UMAGetWindowPort(window ) , &windowMouseLocation ) ;
|
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 ;
|
currentMouseWindow = wxApp::s_captureWindow ;
|
||||||
}
|
}
|
||||||
@@ -1556,6 +1572,9 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
{
|
{
|
||||||
wxSize sz = GetClientSize();
|
wxSize sz = GetClientSize();
|
||||||
wxRegion rgn(0, 0, sz.x, sz.y);
|
wxRegion rgn(0, 0, sz.x, sz.y);
|
||||||
|
if ( rgn.IsEmpty() )
|
||||||
|
return false ;
|
||||||
|
else
|
||||||
return SetShape(rgn);
|
return SetShape(rgn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user