summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-03-17 11:03:50 (GMT)
committerCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-03-17 11:16:49 (GMT)
commitc8b999d9d1eaf3379233169ccd4e9ea8c86a1702 (patch)
treec9f3822022696b49a880177d299dfae19b2ee398 /src/gui
parente62a99d588eaf2b7443250f36c42762a0631c02a (diff)
downloadQt-c8b999d9d1eaf3379233169ccd4e9ea8c86a1702.zip
Qt-c8b999d9d1eaf3379233169ccd4e9ea8c86a1702.tar.gz
Qt-c8b999d9d1eaf3379233169ccd4e9ea8c86a1702.tar.bz2
"Strictly" Fullscreen Application in Mac OS
Full screen in OSX is achieved by using the Kiosk Mode. Therefore it is not a real full screen but an emulation since we basically disable the dock and the menubar. Previous to this patch we were autoshowing the menubar all the time even when we didn't have a menubar. The problem with that is the fact that in OSX there is always a system menubar, so the menubar appeared the moment somebody hovered over the menubar region. With this patch we check if we have created a menubar and if so we autoshow the menubar, otherwise the menubar will remain hidden in full screen mode. Task-number: QTBUG-8933 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qmenu_mac.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 43722a1..627043d 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -2060,6 +2060,22 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly()
QWidget *w = findWindowThatShouldDisplayMenubar();
QMenuBar *mb = findMenubarForWindow(w);
+ // We need to see if we are in full screen mode, if so we need to
+ // switch the full screen mode to be able to show or hide the menubar.
+ if(w && mb) {
+ // This case means we are creating a menubar, check if full screen
+ if(w->isFullScreen()) {
+ // Ok, switch to showing the menubar when hovering over it.
+ SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+ }
+ } else if(w) {
+ // Removing a menubar
+ if(w->isFullScreen()) {
+ // Ok, switch to not showing the menubar when hovering on it
+ SetSystemUIMode(kUIModeAllHidden, 0);
+ }
+ }
+
if (mb && mb->isNativeMenuBar()) {
bool modal = QApplicationPrivate::modalState();
#ifdef QT_MAC_USE_COCOA