summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r--src/gui/widgets/qmenu_mac.mm15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 658a020..99c550f 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -2030,6 +2030,18 @@ void qt_mac_clear_menubar()
*/
bool QMenuBar::macUpdateMenuBar()
{
+#ifdef QT_MAC_USE_COCOA
+ QMacCocoaAutoReleasePool pool;
+ if (!qt_cocoaPostMessage(getMenuLoader(), @selector(qtUpdateMenubar)))
+ return QMenuBarPrivate::macUpdateMenuBarImmediatly();
+ return true;
+#else
+ return QMenuBarPrivate::macUpdateMenuBarImmediatly();
+#endif
+}
+
+bool QMenuBarPrivate::macUpdateMenuBarImmediatly()
+{
bool ret = false;
cancelAllMenuTracking();
QWidget *w = findWindowThatShouldDisplayMenubar();
@@ -2095,8 +2107,9 @@ bool QMenuBar::macUpdateMenuBar()
}
}
- if(!ret)
+ if (!ret) {
qt_mac_clear_menubar();
+ }
return ret;
}