Bug 1441378 - Replace baseMenuOverlay.xul with inlining and preprocessing. r?gijs draft
authorBrendan Dahl <brendan.dahl@gmail.com>
Mon, 26 Feb 2018 16:49:34 -0800
changeset 762280 2649004856e90e2b6f42d8896c6ea0f75f93fbae
parent 761128 c50f5f846c2e6b4c8da1e80b6790926ad84c3450
push id101116
push userbmo:bdahl@mozilla.com
push dateThu, 01 Mar 2018 23:39:59 +0000
reviewersgijs
bugs1441378
milestone60.0a1
Bug 1441378 - Replace baseMenuOverlay.xul with inlining and preprocessing. r?gijs The overlay defined two elements (helpMenu, menu_ToolsPopup) for all platforms and three others (windowMenu, baseMenuCommandSet, baseMenuKeyset) that were MacOS only. The two all platform elements and windowMenu were only used once and inlined into browser-menubar.inc. The rest of the MacOS only elements were conditionally inlined into browser-sets.inc. MozReview-Commit-ID: D2uyCrnepuH
browser/base/content/aboutDialog.xul
browser/base/content/baseMenuOverlay.xul
browser/base/content/browser-doctype.inc
browser/base/content/browser-menubar.inc
browser/base/content/browser-sets.inc
browser/base/content/browser.xul
browser/base/content/browserMountPoints.inc
browser/base/content/hiddenWindow.xul
browser/base/content/macBrowserOverlay.xul
browser/base/content/pageinfo/pageInfo.xul
browser/base/jar.mn
browser/components/places/content/places.xul
browser/components/shell/content/setDesktopBackground.xul
toolkit/content/macWindowMenu.inc
--- a/browser/base/content/aboutDialog.xul
+++ b/browser/base/content/aboutDialog.xul
@@ -8,16 +8,20 @@
 <?xml-stylesheet href="chrome://browser/content/aboutDialog.css" type="text/css"?>
 <?xml-stylesheet href="chrome://branding/content/aboutDialog.css" type="text/css"?>
 
 <!DOCTYPE window [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
 %brandDTD;
 <!ENTITY % aboutDialogDTD SYSTEM "chrome://browser/locale/aboutDialog.dtd" >
 %aboutDialogDTD;
+#ifdef XP_MACOSX
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
+#endif
 ]>
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 #endif
 
 <window xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
deleted file mode 100644
--- a/browser/base/content/baseMenuOverlay.xul
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0"?>
-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-<!DOCTYPE overlay [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-%brandDTD;
-<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
-%baseMenuOverlayDTD;
-<!ENTITY % reportphishDTD SYSTEM "chrome://browser/locale/safebrowsing/report-phishing.dtd">
-%reportphishDTD;
-<!ENTITY % safebrowsingDTD SYSTEM "chrome://browser/locale/safebrowsing/phishing-afterload-warning-message.dtd">
-%safebrowsingDTD;
-]>
-<overlay id="baseMenuOverlay"
-         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
-
-#ifdef XP_MACOSX
-<!-- nsMenuBarX hides these and uses them to build the Application menu.
-     When using Carbon widgets for Mac OS X widgets, some of these are not
-     used as they only apply to Cocoa widget builds. All version of Firefox
-     through Firefox 2 will use Carbon widgets. -->
-    <menupopup id="menu_ToolsPopup">
-        <menuitem id="menu_preferences" label="&preferencesCmdMac.label;" key="key_preferencesCmdMac" oncommand="openPreferences(undefined, {origin: 'commandLineLegacy'});"/>
-        <menuitem id="menu_mac_services" label="&servicesMenuMac.label;"/>
-        <menuitem id="menu_mac_hide_app" label="&hideThisAppCmdMac2.label;" key="key_hideThisAppCmdMac"/>
-        <menuitem id="menu_mac_hide_others" label="&hideOtherAppsCmdMac.label;" key="key_hideOtherAppsCmdMac"/>
-        <menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
-    </menupopup>
-<!-- Mac window menu -->
-#include ../../../toolkit/content/macWindowMenu.inc
-#endif
-
-#ifdef XP_WIN
-    <menu id="helpMenu"
-          label="&helpMenuWin.label;"
-          accesskey="&helpMenuWin.accesskey;">
-#else
-    <menu id="helpMenu"
-          label="&helpMenu.label;"
-          accesskey="&helpMenu.accesskey;">
-#endif
-      <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
-        <menuitem id="menu_openHelp"
-                  oncommand="openHelpLink('firefox-help')"
-                  onclick="checkForMiddleClick(this, event);"
-                  label="&productHelp2.label;"
-                  accesskey="&productHelp2.accesskey;"
-#ifdef XP_MACOSX
-                  key="key_openHelpMac"/>
-#else
-                  />
-#endif
-        <menuitem id="menu_openTour"
-                  oncommand="openTourPage();"
-                  label="&helpShowTour2.label;"
-                  accesskey="&helpShowTour2.accesskey;"/>
-        <menuitem id="menu_keyboardShortcuts"
-                  oncommand="openHelpLink('keyboard-shortcuts')"
-                  onclick="checkForMiddleClick(this, event);"
-                  label="&helpKeyboardShortcuts.label;"
-                  accesskey="&helpKeyboardShortcuts.accesskey;"/>
-        <menuitem id="troubleShooting"
-                  accesskey="&helpTroubleshootingInfo.accesskey;"
-                  label="&helpTroubleshootingInfo.label;"
-                  oncommand="openTroubleshootingPage()"
-                  onclick="checkForMiddleClick(this, event);"/>
-        <menuitem id="feedbackPage"
-                  accesskey="&helpFeedbackPage.accesskey;"
-                  label="&helpFeedbackPage.label;"
-                  oncommand="openFeedbackPage()"
-                  onclick="checkForMiddleClick(this, event);"/>
-        <menuitem id="helpSafeMode"
-                  accesskey="&helpSafeMode.accesskey;"
-                  label="&helpSafeMode.label;"
-                  stopaccesskey="&helpSafeMode.stop.accesskey;"
-                  stoplabel="&helpSafeMode.stop.label;"
-                  oncommand="safeModeRestart();"/>
-        <menuitem id="menu_HelpPopup_reportPhishingtoolmenu"
-                  label="&reportDeceptiveSiteMenu.title;"
-                  accesskey="&reportDeceptiveSiteMenu.accesskey;"
-                  observes="reportPhishingBroadcaster"
-                  oncommand="openUILink(gSafeBrowsing.getReportURL('Phish'), event);"
-                  onclick="checkForMiddleClick(this, event);"
-                  hidden="true"/>
-        <menuitem id="menu_HelpPopup_reportPhishingErrortoolmenu"
-                  label="&safeb.palm.notdeceptive.label;"
-                  accesskey="&safeb.palm.notdeceptive.accesskey;"
-                  observes="reportPhishingErrorBroadcaster"
-                  oncommand="ReportFalseDeceptiveSite();"
-                  onclick="checkForMiddleClick(this, event);"
-                  hidden="true"/>
-        <menuseparator id="aboutSeparator"/>
-        <menuitem id="aboutName"
-                  accesskey="&aboutProduct2.accesskey;"
-                  label="&aboutProduct2.label;"
-                  oncommand="openAboutDialog();"/>
-      </menupopup>
-    </menu>
-
-    <keyset id="baseMenuKeyset">
-#ifdef XP_MACOSX
-        <key id="key_openHelpMac"
-             oncommand="openHelpLink('firefox-osxkey');"
-             key="&helpMac.commandkey;"
-             modifiers="accel"/>
-<!-- These are used to build the Application menu under Cocoa widgets -->
-        <key id="key_preferencesCmdMac"
-             key="&preferencesCmdMac.commandkey;"
-             modifiers="accel"/>
-        <key id="key_hideThisAppCmdMac"
-             key="&hideThisAppCmdMac2.commandkey;"
-             modifiers="accel"/>
-        <key id="key_hideOtherAppsCmdMac"
-             key="&hideOtherAppsCmdMac.commandkey;"
-             modifiers="accel,alt"/>
-#endif
-    </keyset>
-</overlay>
--- a/browser/base/content/browser-doctype.inc
+++ b/browser/base/content/browser-doctype.inc
@@ -14,10 +14,12 @@
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 <!ENTITY % safebrowsingDTD SYSTEM "chrome://browser/locale/safebrowsing/phishing-afterload-warning-message.dtd">
 %safebrowsingDTD;
 <!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
 %aboutHomeDTD;
 <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd">
 %syncBrandDTD;
+<!ENTITY % reportphishDTD SYSTEM "chrome://browser/locale/safebrowsing/report-phishing.dtd">
+%reportphishDTD;
 ]>
 
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -534,16 +534,101 @@
                         oncommand="openPreferences(undefined, {origin: 'menubar'});"/>
 #endif
 #ifdef MOZ_DEBUG
               <menuitem label="&ldbCmd.label;"
                         accesskey="&ldbCmd.accesskey;"
                         oncommand="toOpenWindowByType('mozapp:layoutdebug',
                                           'chrome://layoutdebug/content/');"/>
 #endif
+#ifdef XP_MACOSX
+<!-- nsMenuBarX hides these and uses them to build the Application menu. -->
+              <menuitem id="menu_preferences" label="&preferencesCmdMac.label;" key="key_preferencesCmdMac" oncommand="openPreferences(undefined, {origin: 'commandLineLegacy'});"/>
+              <menuitem id="menu_mac_services" label="&servicesMenuMac.label;"/>
+              <menuitem id="menu_mac_hide_app" label="&hideThisAppCmdMac2.label;" key="key_hideThisAppCmdMac"/>
+              <menuitem id="menu_mac_hide_others" label="&hideOtherAppsCmdMac.label;" key="key_hideOtherAppsCmdMac"/>
+              <menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
+#endif
               </menupopup>
             </menu>
-
+#ifdef XP_MACOSX
+            <menu id="windowMenu"
+                  label="&windowMenu.label;"
+                  onpopupshowing="macWindowMenuDidShow();"
+                  onpopuphidden="macWindowMenuDidHide();"
+                  >
+                <menupopup id="windowPopup">
+                    <menuitem command="minimizeWindow" key="key_minimizeWindow"/>
+                    <menuitem command="zoomWindow"/>
+                    <!-- decomment when "BringAllToFront" is implemented
+                        <menuseparator/>
+                        <menuitem label="&bringAllToFront.label;" disabled="true"/> -->
+                    <menuseparator id="sep-window-list"/>
+                </menupopup>
+            </menu>
+#endif
+            <menu id="helpMenu"
+#ifdef XP_WIN
+                  label="&helpMenuWin.label;"
+                  accesskey="&helpMenuWin.accesskey;"
+#else
+                  label="&helpMenu.label;"
+                  accesskey="&helpMenu.accesskey;"
+#endif
+                  >
+              <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
+                <menuitem id="menu_openHelp"
+                          oncommand="openHelpLink('firefox-help')"
+                          onclick="checkForMiddleClick(this, event);"
+                          label="&productHelp2.label;"
+                          accesskey="&productHelp2.accesskey;"
 #ifdef XP_MACOSX
-          <menu id="windowMenu" />
+                          key="key_openHelpMac"/>
+#else
+                          />
 #endif
-          <menu id="helpMenu" />
+                <menuitem id="menu_openTour"
+                          oncommand="openTourPage();"
+                          label="&helpShowTour2.label;"
+                          accesskey="&helpShowTour2.accesskey;"/>
+                <menuitem id="menu_keyboardShortcuts"
+                          oncommand="openHelpLink('keyboard-shortcuts')"
+                          onclick="checkForMiddleClick(this, event);"
+                          label="&helpKeyboardShortcuts.label;"
+                          accesskey="&helpKeyboardShortcuts.accesskey;"/>
+                <menuitem id="troubleShooting"
+                          accesskey="&helpTroubleshootingInfo.accesskey;"
+                          label="&helpTroubleshootingInfo.label;"
+                          oncommand="openTroubleshootingPage()"
+                          onclick="checkForMiddleClick(this, event);"/>
+                <menuitem id="feedbackPage"
+                          accesskey="&helpFeedbackPage.accesskey;"
+                          label="&helpFeedbackPage.label;"
+                          oncommand="openFeedbackPage()"
+                          onclick="checkForMiddleClick(this, event);"/>
+                <menuitem id="helpSafeMode"
+                          accesskey="&helpSafeMode.accesskey;"
+                          label="&helpSafeMode.label;"
+                          stopaccesskey="&helpSafeMode.stop.accesskey;"
+                          stoplabel="&helpSafeMode.stop.label;"
+                          oncommand="safeModeRestart();"/>
+                <menuitem id="menu_HelpPopup_reportPhishingtoolmenu"
+                          label="&reportDeceptiveSiteMenu.title;"
+                          accesskey="&reportDeceptiveSiteMenu.accesskey;"
+                          observes="reportPhishingBroadcaster"
+                          oncommand="openUILink(gSafeBrowsing.getReportURL('Phish'), event);"
+                          onclick="checkForMiddleClick(this, event);"
+                          hidden="true"/>
+                <menuitem id="menu_HelpPopup_reportPhishingErrortoolmenu"
+                          label="&safeb.palm.notdeceptive.label;"
+                          accesskey="&safeb.palm.notdeceptive.accesskey;"
+                          observes="reportPhishingErrorBroadcaster"
+                          oncommand="ReportFalseDeceptiveSite();"
+                          onclick="checkForMiddleClick(this, event);"
+                          hidden="true"/>
+                <menuseparator id="aboutSeparator"/>
+                <menuitem id="aboutName"
+                          accesskey="&aboutProduct2.accesskey;"
+                          label="&aboutProduct2.label;"
+                          oncommand="openAboutDialog();"/>
+              </menupopup>
+          </menu>
         </menubar>
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -101,16 +101,25 @@
     <command id="Tools:PrivateBrowsing"
       oncommand="OpenBrowserWindow({private: true});"/>
     <command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
     <command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
 
 #ifdef NIGHTLY_BUILD
     <command id="wrCaptureCmd" oncommand="gWebRender.capture();"/>
 #endif
+#ifdef XP_MACOSX
+    <script type="application/javascript" src="chrome://global/content/macWindowMenu.js"/>
+    <command id="minimizeWindow"
+             label="&minimizeWindow.label;"
+             oncommand="window.minimize();" />
+    <command id="zoomWindow"
+             label="&zoomWindow.label;"
+             oncommand="zoomWindow();" />
+#endif
   </commandset>
 
   <commandset id="placesCommands">
     <command id="Browser:ShowAllBookmarks"
              oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"/>
     <command id="Browser:ShowAllHistory"
              oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
   </commandset>
@@ -392,15 +401,29 @@
     <key id="key_wrCaptureCmd"
 #ifdef XP_MACOSX
     key="3" modifiers="control,shift"
 #else
     key="#" modifiers="control"
 #endif
     command="wrCaptureCmd"/>
 #endif
+#ifdef XP_MACOSX
+    <key id="key_minimizeWindow"
+         command="minimizeWindow"
+         key="&minimizeWindow.key;"
+         modifiers="accel"/>
+    <key id="key_openHelpMac"
+         oncommand="openHelpLink('firefox-osxkey');"
+         key="&helpMac.commandkey;"
+         modifiers="accel"/>
+    <!-- These are used to build the Application menu -->
+    <key id="key_preferencesCmdMac"
+         key="&preferencesCmdMac.commandkey;"
+         modifiers="accel"/>
+    <key id="key_hideThisAppCmdMac"
+         key="&hideThisAppCmdMac2.commandkey;"
+         modifiers="accel"/>
+    <key id="key_hideOtherAppsCmdMac"
+         key="&hideOtherAppsCmdMac.commandkey;"
+         modifiers="accel,alt"/>
+#endif
   </keyset>
-
-# Used by baseMenuOverlay
-#ifdef XP_MACOSX
-  <commandset id="baseMenuCommandSet" />
-#endif
-  <keyset id="baseMenuKeyset" />
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -11,17 +11,16 @@
 <?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/controlcenter/panel.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/customizableui/panelUI.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/downloads/downloads.css"?>
 <?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/content/tabbrowser.css" type="text/css"?>
 
-<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
 <?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
 
 # All DTD information is stored in a separate file so that it can be shared by
 # hiddenWindow.xul.
 #include browser-doctype.inc
 
 <window id="main-window"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
--- a/browser/base/content/browserMountPoints.inc
+++ b/browser/base/content/browserMountPoints.inc
@@ -1,10 +1,9 @@
 <commandset id="mainCommandSet"/>
 <commandset id="baseMenuCommandSet"/>
 <commandset id="placesCommands"/>
 
 <broadcasterset id="mainBroadcasterSet"/>
 
 <keyset id="mainKeyset"/>
-<keyset id="baseMenuKeyset"/>
 
 <menubar id="main-menubar"/>
\ No newline at end of file
--- a/browser/base/content/hiddenWindow.xul
+++ b/browser/base/content/hiddenWindow.xul
@@ -4,16 +4,21 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 <?xml-stylesheet href="chrome://browser/skin/webRTC-indicator.css" type="text/css"?>
 
+<!DOCTYPE window [
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
+]>
+
 <window id="main-window"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 #include browserMountPoints.inc
 
 </window>
 
--- a/browser/base/content/macBrowserOverlay.xul
+++ b/browser/base/content/macBrowserOverlay.xul
@@ -5,17 +5,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #define MAC_NON_BROWSER_WINDOW
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
 
-<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
 <?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
 
 # All DTD information is stored in a separate file so that it can be shared by
 # hiddenWindow.xul.
 #include browser-doctype.inc
 
 <overlay id="hidden-overlay"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -4,16 +4,20 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <?xml-stylesheet href="chrome://browser/content/pageinfo/pageInfo.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/pageInfo.css" type="text/css"?>
 
 <!DOCTYPE window [
   <!ENTITY % pageInfoDTD SYSTEM "chrome://browser/locale/pageInfo.dtd">
   %pageInfoDTD;
+#ifdef XP_MACOSX
+  <!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
+  %baseMenuOverlayDTD;
+#endif
 ]>
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 #endif
 
 <window id="main-window"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -120,17 +120,16 @@ browser.jar:
         content/browser/tabbrowser.js                 (content/tabbrowser.js)
         content/browser/tabbrowser.xml                (content/tabbrowser.xml)
 *       content/browser/urlbarBindings.xml            (content/urlbarBindings.xml)
         content/browser/utilityOverlay.js             (content/utilityOverlay.js)
         content/browser/web-panels.js                 (content/web-panels.js)
 *       content/browser/web-panels.xul                (content/web-panels.xul)
         content/browser/webext-panels.js              (content/webext-panels.js)
 *       content/browser/webext-panels.xul             (content/webext-panels.xul)
-*       content/browser/baseMenuOverlay.xul           (content/baseMenuOverlay.xul)
         content/browser/nsContextMenu.js              (content/nsContextMenu.js)
 # XXX: We should exclude this one as well (bug 71895)
 *       content/browser/hiddenWindow.xul              (content/hiddenWindow.xul)
 #ifdef XP_MACOSX
 *       content/browser/macBrowserOverlay.xul         (content/macBrowserOverlay.xul)
 #endif
 #ifndef XP_MACOSX
 *       content/browser/webrtcIndicator.xul           (content/webrtcIndicator.xul)
--- a/browser/components/places/content/places.xul
+++ b/browser/components/places/content/places.xul
@@ -11,27 +11,30 @@
 <?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
 <?xml-stylesheet href="chrome://browser/skin/places/organizer.css"?>
 
 <?xul-overlay href="chrome://browser/content/places/editBookmarkOverlay.xul"?>
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 #else
-<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
 <?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
 #endif
 
 <!DOCTYPE window [
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 <!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
 %editMenuOverlayDTD;
 <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
 %browserDTD;
+#ifdef XP_MACOSX
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
+#endif
 ]>
 
 <window id="places"
         title="&places.library.title;"
         windowtype="Places:Organizer"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         onload="PlacesOrganizer.init();"
--- a/browser/components/shell/content/setDesktopBackground.xul
+++ b/browser/components/shell/content/setDesktopBackground.xul
@@ -2,17 +2,25 @@
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
 <?xml-stylesheet href="chrome://browser/skin/setDesktopBackground.css" type="text/css"?>
 
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/setDesktopBackground.dtd">
+
+<!DOCTYPE dialog [
+<!ENTITY % setDesktopBackgroundDTD SYSTEM "chrome://browser/locale/setDesktopBackground.dtd">
+%setDesktopBackgroundDTD;
+#ifdef XP_MACOSX
+<!ENTITY % baseMenuOverlayDTD SYSTEM "chrome://browser/locale/baseMenuOverlay.dtd">
+%baseMenuOverlayDTD;
+#endif
+]>
 
 #ifdef XP_MACOSX
 <?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
 #endif
 
 <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         xmlns:html="http://www.w3.org/1999/xhtml"
         windowtype="Shell:SetDesktopBackground"
deleted file mode 100644
--- a/toolkit/content/macWindowMenu.inc
+++ /dev/null
@@ -1,29 +0,0 @@
-    <script type="application/javascript" src="chrome://global/content/macWindowMenu.js"/>
-    <commandset id="baseMenuCommandSet">
-        <command id="minimizeWindow"
-                 label="&minimizeWindow.label;"
-                 oncommand="window.minimize();" />
-        <command id="zoomWindow"
-                 label="&zoomWindow.label;"
-                 oncommand="zoomWindow();" />
-    </commandset>
-    <keyset id="baseMenuKeyset">
-        <key id="key_minimizeWindow"
-             command="minimizeWindow"
-             key="&minimizeWindow.key;"
-             modifiers="accel"/>
-    </keyset>
-    <menu id="windowMenu"
-          label="&windowMenu.label;"
-          onpopupshowing="macWindowMenuDidShow();"
-          onpopuphidden="macWindowMenuDidHide();"
-          >
-        <menupopup id="windowPopup">
-            <menuitem command="minimizeWindow" key="key_minimizeWindow"/>
-            <menuitem command="zoomWindow"/>
-            <!-- decomment when "BringAllToFront" is implemented
-                <menuseparator/>
-                <menuitem label="&bringAllToFront.label;" disabled="true"/> -->
-            <menuseparator id="sep-window-list"/>
-        </menupopup>
-    </menu>