src/gui/kernel/qcocoamenuloader_mac.mm
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
--- a/src/gui/kernel/qcocoamenuloader_mac.mm	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/kernel/qcocoamenuloader_mac.mm	Tue Feb 02 00:43:10 2010 +0200
@@ -76,9 +76,14 @@
 
 - (void)ensureAppMenuInMenu:(NSMenu *)menu
 {
+    // The application menu is the menu in the menu bar that contains the
+    // 'Quit' item. When changing menu bar (e.g when swithing between
+    // windows with different menu bars), we never recreate this menu, but
+    // instead pull it out the current menu bar and place into the new one:
     NSMenu *mainMenu = [NSApp mainMenu];
     if ([NSApp mainMenu] == menu)
-        return; // nothing to do!
+        return; // nothing to do (menu is the current menu bar)!
+
 #ifndef QT_NAMESPACE
     Q_ASSERT(mainMenu);
 #endif