summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-04-21 10:47:29 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-04-21 10:47:29 (GMT)
commitfcba9ea8c646f1f3ed7e8b8c75bb841f9116ee7d (patch)
tree5bbfe9dfd3d1ea5f2ba2fce4d8be9c50265df730 /src/gui/kernel
parent11dad6b10cbf4f3727e03669cfa04a623f1b6308 (diff)
downloadQt-fcba9ea8c646f1f3ed7e8b8c75bb841f9116ee7d.zip
Qt-fcba9ea8c646f1f3ed7e8b8c75bb841f9116ee7d.tar.gz
Qt-fcba9ea8c646f1f3ed7e8b8c75bb841f9116ee7d.tar.bz2
Cocoa: cocoa sometimes show a hidden window
If we tell the only window in an app to hide, deactivate the app, and then activate it again, the window will show on screen (and be unresponsive). The reason is that cocoa still sees the window as the main window (and I cannot find a way to tell cocoa otherwise). This patch works around the problem by hiding the window again if it becomes main while being hidden. Reviewed-by: msorvig
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoasharedwindowmethods_mac_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
index ec00915..e94d247 100644
--- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
+++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
@@ -101,6 +101,17 @@ QT_END_NAMESPACE
return !(isPopup || isToolTip || isTool);
}
+- (void)becomeMainWindow
+{
+ [super becomeMainWindow];
+ // Cocoa sometimes tell a hidden window to become the
+ // main window (and as such, show it). This can e.g
+ // happend when the application gets activated. If
+ // this is the case, we tell it to hide again:
+ if (![self isVisible])
+ [self orderOut:self];
+}
+
- (void)toggleToolbarShown:(id)sender
{
macSendToolbarChangeEvent([self QT_MANGLE_NAMESPACE(qt_qwidget)]);