diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-25 11:29:10 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-25 11:36:31 (GMT) |
commit | 1666247307a70bbf180a9e63bb546029994bd194 (patch) | |
tree | 1e633b92769ddfb17f700af9146d3947b3759a9d /src | |
parent | f384dd306c022aa70015133be3a7b4d4c8bb1121 (diff) | |
download | Qt-1666247307a70bbf180a9e63bb546029994bd194.zip Qt-1666247307a70bbf180a9e63bb546029994bd194.tar.gz Qt-1666247307a70bbf180a9e63bb546029994bd194.tar.bz2 |
Mac: respect Qt::AA_MacPluginApplication and disable native menubar
Adding a second patch to this problem. This patch hooks into an
earlier stage in the 'use native' detection
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index d9c1283..47a8042 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -1757,14 +1757,16 @@ void QMenuBarPrivate::macCreateMenuBar(QWidget *parent) { Q_Q(QMenuBar); - static int checkEnv = -1; + static int dontUseNativeMenuBar = -1; // We call the isNativeMenuBar function here - // becasue that will make sure that local overrides + // because that will make sure that local overrides // are dealt with correctly. bool qt_mac_no_native_menubar = !q->isNativeMenuBar(); - if (qt_mac_no_native_menubar == false && checkEnv < 0) { - checkEnv = !qgetenv("QT_MAC_NO_NATIVE_MENUBAR").isEmpty(); - QApplication::instance()->setAttribute(Qt::AA_DontUseNativeMenuBar, checkEnv); + if (qt_mac_no_native_menubar == false && dontUseNativeMenuBar < 0) { + bool isPlugin = QApplication::testAttribute(Qt::AA_MacPluginApplication); + bool environmentSaysNo = !qgetenv("QT_MAC_NO_NATIVE_MENUBAR").isEmpty(); + dontUseNativeMenuBar = isPlugin || environmentSaysNo; + QApplication::instance()->setAttribute(Qt::AA_DontUseNativeMenuBar, dontUseNativeMenuBar); qt_mac_no_native_menubar = !q->isNativeMenuBar(); } if (!qt_mac_no_native_menubar) { @@ -1921,9 +1923,6 @@ static void cancelAllMenuTracking() */ bool QMenuBar::macUpdateMenuBar() { - if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) - return false; - cancelAllMenuTracking(); QMenuBar *mb = 0; //find a menu bar |