OS X: fix startup sequence when restoring session on >=10.7.
Make sure that OnInit() is called before MacReopenApp(). This is normally the case, but it is possible for it to be called as the first thing. This can happen when OS X restores running apps when starting a new user session. Apps that were hidden (dock only) when the previous session terminated are only restored in a limited, resources-saving way - the event loop is running, but didn't call anything in the app delegate yet. When the user clicks the icon, applicationShouldHandleReopen: is called, but we didn't call OnInit() yet. In this case, we shouldn't call MacReopenApp(), but should proceed with normal initialization. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -109,7 +109,16 @@ void wxBell()
|
||||
{
|
||||
wxUnusedVar(flag);
|
||||
wxUnusedVar(sender);
|
||||
wxTheApp->MacReopenApp() ;
|
||||
if ( wxTheApp->OSXInitWasCalled() )
|
||||
wxTheApp->MacReopenApp();
|
||||
// else: It's possible that this function was called as the first thing.
|
||||
// This can happen when OS X restores running apps when starting a new
|
||||
// user session. Apps that were hidden (dock only) when the previous
|
||||
// session terminated are only restored in a limited, resources-saving
|
||||
// way. When the user clicks the icon, applicationShouldHandleReopen:
|
||||
// is called, but we didn't call OnInit() yet. In this case, we
|
||||
// shouldn't call MacReopenApp(), but should proceed with normal
|
||||
// initialization.
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user