backport, add our own Apple Event handler for the quit app event, see #16200
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -61,6 +61,9 @@ void wxBell()
|
|||||||
[appleEventManager setEventHandler:self andSelector:@selector(handleOpenAppEvent:withReplyEvent:)
|
[appleEventManager setEventHandler:self andSelector:@selector(handleOpenAppEvent:withReplyEvent:)
|
||||||
forEventClass:kCoreEventClass andEventID:kAEOpenApplication];
|
forEventClass:kCoreEventClass andEventID:kAEOpenApplication];
|
||||||
|
|
||||||
|
[appleEventManager setEventHandler:self andSelector:@selector(handleQuitAppEvent:withReplyEvent:)
|
||||||
|
forEventClass:kCoreEventClass andEventID:kAEQuitApplication];
|
||||||
|
|
||||||
wxTheApp->OSXOnWillFinishLaunching();
|
wxTheApp->OSXOnWillFinishLaunching();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,6 +137,16 @@ void wxBell()
|
|||||||
wxTheApp->OSXStoreOpenURL(cf.AsString());
|
wxTheApp->OSXStoreOpenURL(cf.AsString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)handleQuitAppEvent:(NSAppleEventDescriptor *)event
|
||||||
|
withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||||
|
{
|
||||||
|
if ( wxTheApp->OSXOnShouldTerminate() )
|
||||||
|
{
|
||||||
|
wxTheApp->OSXOnWillTerminate();
|
||||||
|
wxTheApp->ExitMainLoop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)handleOpenAppEvent:(NSAppleEventDescriptor *)event
|
- (void)handleOpenAppEvent:(NSAppleEventDescriptor *)event
|
||||||
withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user