From: Stefan Csomor Date: Sun, 26 Feb 2012 13:30:55 +0000 (+0000) Subject: also a dialog needs the current events set up correctly X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/968978c0e4e9b4c59cfa6ff811610efdb720c068 also a dialog needs the current events set up correctly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 6413556029..81ecf321aa 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -267,7 +267,18 @@ bool shouldHandleSelector(SEL selector) - (void)sendEvent:(NSEvent *) event { if ( ![self WX_filterSendEvent: event] ) + { + WXEVENTREF formerEvent = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEvent(); + WXEVENTHANDLERCALLREF formerHandler = wxTheApp == NULL ? NULL : wxTheApp->MacGetCurrentEventHandlerCallRef(); + + if (wxTheApp) + wxTheApp->MacSetCurrentEvent(event, NULL); + [super sendEvent: event]; + + if (wxTheApp) + wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler); + } } @end