diff options
author | Samuel Gaist <samuel.gaist@edeltech.ch> | 2014-04-16 06:16:04 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-17 18:28:04 (GMT) |
commit | 3d5122eab127fbe13d4e13a92ee5f6d6686d2f2f (patch) | |
tree | bc374a24b69dc4def00c44ac9497fe339d53af14 /src/gui | |
parent | 04c780dcf681074623c11abb4786d75a018ac40d (diff) | |
download | Qt-3d5122eab127fbe13d4e13a92ee5f6d6686d2f2f.zip Qt-3d5122eab127fbe13d4e13a92ee5f6d6686d2f2f.tar.gz Qt-3d5122eab127fbe13d4e13a92ee5f6d6686d2f2f.tar.bz2 |
OS X: Make Qt application react on applicationShouldHandleReopen
Currently a click on e.g. the dock icon is not propagated to the
application so if for example the main widget is hidden, it doesn't come
back. This patch fixes it
Task-number: QTBUG-10899
[ChangeLog][QtGui][OS X] Fixes a bug where clicking on the dock icon
would not be propagated to the application
Change-Id: Ia02ca23ed0dafbd337d1d7d9bc5f7efe3843b512
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 80bd7a9..d45f5f1 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -289,6 +289,19 @@ static void cleanupCocoaApplicationDelegate() qt_button_down = 0; } +- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag +{ + Q_UNUSED(theApplication); + Q_UNUSED(flag); + // The reflection delegate gets precedence + if (reflectionDelegate + && [reflectionDelegate respondsToSelector:@selector(applicationShouldHandleReopen:hasVisibleWindows:)]) + return [reflectionDelegate applicationShouldHandleReopen:theApplication hasVisibleWindows:flag]; + + onApplicationChangedActivation(true); + return NO; +} + - (void)applicationDidChangeScreenParameters:(NSNotification *)notification { Q_UNUSED(notification); |