diff options
author | Norwegian Rock Cat <qt-info@nokia.com> | 2009-03-30 15:08:13 (GMT) |
---|---|---|
committer | Norwegian Rock Cat <qt-info@nokia.com> | 2009-03-30 15:12:54 (GMT) |
commit | 25fcffe289e5117c71335bb7fe259751056d4dda (patch) | |
tree | 04c29275076bff8d20b61cf2047d339423b72deb /src/gui/kernel | |
parent | ae1606b18c099b743e3cb410395b35ee290ae335 (diff) | |
download | Qt-25fcffe289e5117c71335bb7fe259751056d4dda.zip Qt-25fcffe289e5117c71335bb7fe259751056d4dda.tar.gz Qt-25fcffe289e5117c71335bb7fe259751056d4dda.tar.bz2 |
Consistency between Carbon and Cocoa with fullscreen mode.
On Carbon, we did show/hide menubar, on Cocoa we used SetSystemUIMode.
But SetSystemUIMode is available to both, so why not just do that and
make everything consistent. We now act more like other fullscreen apps
(i.e., we show the menu and dock when the mouse is close to them). The
good thing is that it should be easier to override this behavior as
well. I also removed some code in our mouse handler where we were
calling HideMenuBar as I don't see a great reason for it at the moment
in any case, it would be inconsistent between Carbon and Cocoa.
Task-number: 249655
Reviewed-by: Prasanth Ullattil
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_mac.mm | 9 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_mac.mm | 16 |
2 files changed, 5 insertions, 20 deletions
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index 5f8c572..ae99e83 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1638,15 +1638,6 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event bool inNonClientArea = false; GetEventParameter(event, kEventParamMouseLocation, typeQDPoint, 0, sizeof(where), 0, &where); - if(ekind == kEventMouseMoved && qt_mac_app_fullscreen && - QApplication::desktop()->screenNumber(QPoint(where.h, where.v)) == - QApplication::desktop()->primaryScreen()) { - if(where.v <= 0) - ShowMenuBar(); - else if(qt_mac_window_at(where.h, where.v, 0) != inMenuBar) - HideMenuBar(); - } - #if defined(DEBUG_MOUSE_MAPS) const char *edesc = 0; switch(ekind) { diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index cd11b52..3b011d5 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -392,21 +392,15 @@ QWidget *qt_mac_find_window(OSWindowRef window) inline static void qt_mac_set_fullscreen_mode(bool b) { - extern bool qt_mac_app_fullscreen; //qapplication_mac.cpp + extern bool qt_mac_app_fullscreen; //qapplication_mac.mm if(qt_mac_app_fullscreen == b) return; qt_mac_app_fullscreen = b; -#if QT_MAC_USE_COCOA - if(b) - SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); - else + if (b) { + SetSystemUIMode(kUIModeAllSuppressed, 0); + } else { SetSystemUIMode(kUIModeNormal, 0); -#else - if(b) - HideMenuBar(); - else - ShowMenuBar(); -#endif + } } Q_GUI_EXPORT OSViewRef qt_mac_nativeview_for(const QWidget *w) |