diff -aur qt-everywhere-commercial-src-4.6.1.orig/src/corelib/global/qnamespace.h qt-everywhere-commercial-src-4.6.1/src/corelib/global/qnamespace.h --- qt-everywhere-commercial-src-4.6.1.orig/src/corelib/global/qnamespace.h 2010-01-15 11:04:07.000000000 -0600 +++ qt-everywhere-commercial-src-4.6.1/src/corelib/global/qnamespace.h 2010-03-10 16:58:40.000000000 -0600 @@ -497,6 +497,8 @@ WA_WState_AcceptedTouchBeginEvent = 122, WA_TouchPadAcceptSingleTouchEvents = 123, + WA_MacStrictFullScreen = 124, // Mac only + // Add new attributes before this line WA_AttributeCount }; diff -aur qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qapplication_mac.mm qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qapplication_mac.mm --- qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qapplication_mac.mm 2010-01-15 11:04:06.000000000 -0600 +++ qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qapplication_mac.mm 2010-03-10 16:51:08.000000000 -0600 @@ -181,6 +181,7 @@ extern QWidgetList *qt_modal_stack; // stack of modal widgets extern bool qt_tab_all_widgets; // from qapplication.cpp bool qt_mac_app_fullscreen = false; +bool qt_mac_app_strict_fullscreen = false; bool qt_scrollbar_jump_to_pos = false; static bool qt_mac_collapse_on_dblclick = true; extern int qt_antialiasing_threshold; // from qapplication.cpp diff -aur qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qwidget.cpp qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qwidget.cpp --- qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qwidget.cpp 2010-01-15 11:04:06.000000000 -0600 +++ qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qwidget.cpp 2010-03-10 16:59:58.000000000 -0600 @@ -2789,6 +2789,27 @@ bool QWidget::isFullScreen() const { return data->window_state & Qt::WindowFullScreen; } +#ifdef Q_WS_MAC +/*! + \property QWidget::strictFullScreen + \brief whether the widget is shown in strict full screen mode + + A widget in full screen mode occupies the whole screen area and does not + display window decorations, such as a title bar. Furthermore, in Mac OS X, + moving the mouse cursor near the top of the window will not activate the + Mac systemwide menubar. + + By default, this property is false. + + \sa windowState(), minimized, maximized +*/ +bool QWidget::strictFullScreen() const +{ return testAttribute(Qt::WA_MacStrictFullScreen); } + +void QWidget::setStrictFullScreen(bool enable) +{ setAttribute(Qt::WA_ForceDisabled, enable); } +#endif + /*! Shows the widget in full-screen mode. diff -aur qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qwidget.h qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qwidget.h --- qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qwidget.h 2010-01-15 11:04:06.000000000 -0600 +++ qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qwidget.h 2010-03-10 16:51:08.000000000 -0600 @@ -182,6 +182,9 @@ Q_PROPERTY(bool minimized READ isMinimized) Q_PROPERTY(bool maximized READ isMaximized) Q_PROPERTY(bool fullScreen READ isFullScreen) +#if defined(Q_WS_MAC) + Q_PROPERTY(bool strictFullScreen READ strictFullScreen WRITE setStrictFullScreen ) +#endif Q_PROPERTY(QSize sizeHint READ sizeHint) Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint) Q_PROPERTY(bool acceptDrops READ acceptDrops WRITE setAcceptDrops) @@ -517,6 +520,10 @@ bool isMinimized() const; bool isMaximized() const; bool isFullScreen() const; +#if defined(Q_WS_MAC) + bool strictFullScreen() const; + void setStrictFullScreen(bool enable); +#endif Qt::WindowStates windowState() const; void setWindowState(Qt::WindowStates state); diff -aur qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qwidget_mac.mm qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qwidget_mac.mm --- qt-everywhere-commercial-src-4.6.1.orig/src/gui/kernel/qwidget_mac.mm 2010-01-15 11:04:06.000000000 -0600 +++ qt-everywhere-commercial-src-4.6.1/src/gui/kernel/qwidget_mac.mm 2010-03-10 17:00:03.000000000 -0600 @@ -396,14 +396,22 @@ #endif } -inline static void qt_mac_set_fullscreen_mode(bool b) +inline static void qt_mac_set_fullscreen_mode(bool b, bool sb) { extern bool qt_mac_app_fullscreen; //qapplication_mac.mm + extern bool qt_mac_app_strict_fullscreen; //qapplication_mac.mm if(qt_mac_app_fullscreen == b) return; qt_mac_app_fullscreen = b; + + if (b && sb) + qt_mac_app_strict_fullscreen = sb; if (b) { - SetSystemUIMode(kUIModeAllSuppressed, 0); + if(qt_mac_app_strict_fullscreen) { + SetSystemUIMode(kUIModeAllHidden, 0); + } else { + SetSystemUIMode(kUIModeAllSuppressed, 0); + } } else { SetSystemUIMode(kUIModeNormal, 0); } @@ -3135,8 +3143,9 @@ } if (fullScreenWidget->windowType() != Qt::ToolTip) { - qt_mac_set_fullscreen_mode((fullScreenWidget->windowState() & Qt::WindowFullScreen) && - qApp->desktop()->screenNumber(this) == 0); + bool fs_state = (fullScreenWidget->windowState() & Qt::WindowFullScreen) && + qApp->desktop()->screenNumber(this) == 0; + qt_mac_set_fullscreen_mode(fs_state,fs_state && testAttribute(Qt::WA_MacStrictFullScreen)); } bool windowActive; @@ -3502,11 +3511,11 @@ setParent(parentWidget(), Qt::Window | Qt::FramelessWindowHint | (windowFlags() & 0xffff0000)); //save setGeometry(fullscreen); if(!qApp->desktop()->screenNumber(this)) - qt_mac_set_fullscreen_mode(true); + qt_mac_set_fullscreen_mode(true, testAttribute(Qt::WA_MacStrictFullScreen)); } else { needShow = isVisible(); if(!qApp->desktop()->screenNumber(this)) - qt_mac_set_fullscreen_mode(false); + qt_mac_set_fullscreen_mode(false, false); setParent(parentWidget(), d->topData()->savedFlags); setGeometry(d->topData()->normalGeometry); d->topData()->normalGeometry.setRect(0, 0, -1, -1);