From: Stefan Csomor Date: Sun, 26 Feb 2012 10:21:03 +0000 (+0000) Subject: setting up current event also when mouse is captured ... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2712275c88c78af135489c22d306ed6ad2ad5b1f?ds=inline setting up current event also when mouse is captured ... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index a11208f4ad..6413556029 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -120,9 +120,14 @@ bool shouldHandleSelector(SEL selector) bool handled = false; if ( ([event type] >= NSLeftMouseDown) && ([event type] <= NSMouseExited) ) { + WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent(); + WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef(); + wxWindow* cw = wxWindow::GetCapture(); if ( cw != NULL ) { + if (wxTheApp) + wxTheApp->MacSetCurrentEvent(event, NULL); ((wxWidgetCocoaImpl*)cw->GetPeer())->DoHandleMouseEvent( event); handled = true; } @@ -136,10 +141,17 @@ bool shouldHandleSelector(SEL selector) wxWindow* mw = ::wxFindWindowAtPoint(pt); if ( mw ) { + if (wxTheApp) + wxTheApp->MacSetCurrentEvent(event, NULL); ((wxWidgetCocoaImpl*)mw->GetPeer())->DoHandleMouseEvent( event); handled = true; } } + if ( handled ) + { + if (wxTheApp) + wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler); + } } return handled; } @@ -469,8 +481,8 @@ extern int wxOSXGetIdFromSelector(SEL action ); [editor release]; } return editor; - } - + } + return nil; }