From 9a683bfb84464bbf051236c4e3c2710219cbf0d5 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 24 Sep 2013 19:37:39 +0200 Subject: QCocoaApplicationDelegate: Play nice with the user's application delegate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We tended to ignore the original application delegate a bit too often. Change-Id: I0844c8658d128e4fbb9a6fc5000025f55e5293c2 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 423d552627..f9767ce716 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -210,9 +210,10 @@ static void cleanupCocoaApplicationDelegate() - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { // The reflection delegate gets precedence - if (reflectionDelegate - && [reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)]) { - return [reflectionDelegate applicationShouldTerminate:sender]; + if (reflectionDelegate) { + if ([reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)]) + return [reflectionDelegate applicationShouldTerminate:sender]; + return NSTerminateNow; } if ([self canQuit]) { @@ -327,12 +328,11 @@ static void cleanupCocoaApplicationDelegate() - (void)applicationDidBecomeActive:(NSNotification *)notification { - Q_UNUSED(notification); -/* if (reflectionDelegate && [reflectionDelegate respondsToSelector:@selector(applicationDidBecomeActive:)]) [reflectionDelegate applicationDidBecomeActive:notification]; +/* onApplicationChangedActivation(true); if (!QWidget::mouseGrabber()){ @@ -351,12 +351,11 @@ static void cleanupCocoaApplicationDelegate() - (void)applicationDidResignActive:(NSNotification *)notification { - Q_UNUSED(notification); -/* if (reflectionDelegate && [reflectionDelegate respondsToSelector:@selector(applicationDidResignActive:)]) [reflectionDelegate applicationDidResignActive:notification]; +/* onApplicationChangedActivation(false); if (!QWidget::mouseGrabber()) -- cgit v1.2.3