diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-01-21 09:17:29 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-01-21 09:26:51 (GMT) |
commit | 0481c2dfbbcc59b76bde3f72fbe6d1e4003c913a (patch) | |
tree | 11f53358176a2a3ef36c8cc6c0dcd78abe2b4b8b /src/gui/kernel/qwidget_mac.mm | |
parent | 1d83d3028320bcc071de1ad65e94f821850bd9be (diff) | |
download | Qt-0481c2dfbbcc59b76bde3f72fbe6d1e4003c913a.zip Qt-0481c2dfbbcc59b76bde3f72fbe6d1e4003c913a.tar.gz Qt-0481c2dfbbcc59b76bde3f72fbe6d1e4003c913a.tar.bz2 |
Menubar and dock disappear after hiding a fullscreen widget on Cocoa.
The problem here was exiting the full screen mode. In Cocoa we don't
activate windows as we do in Carbon, therefore we were not exiting from
the full screen mode. This patch adds a check when hiding a window, if
the window is in full screen mode then we go through the list of top
level windows checking if there are any other visible and not-minimized
windows that are also in full screen mode. If none if found, the we exit
the full screen mode.
Task-number: QTBUG-7312
Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/kernel/qwidget_mac.mm')
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index b18830f..3dbc843 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3414,6 +3414,38 @@ void QWidgetPrivate::hide_sys() ShowHide(window, false); #else [window orderOut:window]; + // Unfortunately it is not as easy as just hiding the window, we need + // to find out if we were in full screen mode. If we were and this is + // the last window in full screen mode then we need to unset the full screen + // mode. If this is not the last visible window in full screen mode then we + // don't change the full screen mode. + if(q->isFullScreen()) + { + bool keepFullScreen = false; + QWidgetList windowList = qApp->topLevelWidgets(); + int windowCount = windowList.count(); + for(int i = 0; i < windowCount; i++) + { + QWidget *w = windowList[i]; + // If it is the same window, we don't need to check :-) + if(q == w) + continue; + // If they are not visible or if they are minimized then + // we just ignore them. + if(!w->isVisible() || w->isMinimized()) + continue; + // Is it full screen? + // Notice that if there is one window in full screen mode then we + // cannot switch the full screen mode off, therefore we just abort. + if(w->isFullScreen()) { + keepFullScreen = true; + break; + } + } + // No windows in full screen mode, so let just unset that flag. + if(!keepFullScreen) + qt_mac_set_fullscreen_mode(false); + } #endif toggleDrawers(false); #ifndef QT_MAC_USE_COCOA |