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
This commit is contained in:
Stefan Csomor
2013-12-09 21:09:34 +00:00
parent 2d8b8e1725
commit 79ec1e6c30

View File

@@ -397,6 +397,8 @@ wxModalEventLoop::wxModalEventLoop(WXWindow modalNativeWindow)
// END move into a evtloop_osx.cpp // END move into a evtloop_osx.cpp
#define OSX_USE_MODAL_SESSION 1
void wxModalEventLoop::OSXDoRun() void wxModalEventLoop::OSXDoRun()
{ {
wxMacAutoreleasePool pool; wxMacAutoreleasePool pool;
@@ -412,14 +414,32 @@ void wxModalEventLoop::OSXDoRun()
[NSApp sendEvent:event]; [NSApp sendEvent:event];
} }
} }
#if OSX_USE_MODAL_SESSION
if ( m_modalWindow )
{
BeginModalSession(m_modalWindow);
wxCFEventLoop::OSXDoRun();
}
else
#endif
{
[NSApp runModalForWindow:m_modalNativeWindow]; [NSApp runModalForWindow:m_modalNativeWindow];
} }
}
void wxModalEventLoop::OSXDoStop() void wxModalEventLoop::OSXDoStop()
{
#if OSX_USE_MODAL_SESSION
if ( m_modalWindow )
{
EndModalSession();
}
else
#endif
{ {
[NSApp abortModal]; [NSApp abortModal];
} }
}
// we need our own version of ProcessIdle here in order to // we need our own version of ProcessIdle here in order to
// avoid deletion of pending objects, because ProcessIdle is running // avoid deletion of pending objects, because ProcessIdle is running