From 79ec1e6c30ec9013d6aeaca83f4306217fad42d2 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 9 Dec 2013 21:09:34 +0000 Subject: [PATCH] trying 10.5 / 10.6 fix for #15688 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/evtloop.mm | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index 3e43d778dc..d571d0484c 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -397,6 +397,8 @@ wxModalEventLoop::wxModalEventLoop(WXWindow modalNativeWindow) // END move into a evtloop_osx.cpp +#define OSX_USE_MODAL_SESSION 1 + void wxModalEventLoop::OSXDoRun() { wxMacAutoreleasePool pool; @@ -412,13 +414,31 @@ void wxModalEventLoop::OSXDoRun() [NSApp sendEvent:event]; } } - - [NSApp runModalForWindow:m_modalNativeWindow]; +#if OSX_USE_MODAL_SESSION + if ( m_modalWindow ) + { + BeginModalSession(m_modalWindow); + wxCFEventLoop::OSXDoRun(); + } + else +#endif + { + [NSApp runModalForWindow:m_modalNativeWindow]; + } } void wxModalEventLoop::OSXDoStop() { - [NSApp abortModal]; +#if OSX_USE_MODAL_SESSION + if ( m_modalWindow ) + { + EndModalSession(); + } + else +#endif + { + [NSApp abortModal]; + } } // we need our own version of ProcessIdle here in order to