Bug 1454440 - Focus the window directly instead of using commandDispatcher in the mac Window menu;r=Gijs draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 16 Apr 2018 11:05:01 -0700
changeset 783169 e2ca69690cfa11716a17dc0ce268a7c4a4aa7e2b
parent 782895 6276ec7ebbf33e3484997b189f20fc1511534187
push id106629
push userbgrinstead@mozilla.com
push dateMon, 16 Apr 2018 18:05:20 +0000
reviewersGijs
bugs1454440
milestone61.0a1
Bug 1454440 - Focus the window directly instead of using commandDispatcher in the mac Window menu;r=Gijs This fixes the Window menu with top-level HTML windows, which don't have `commandDispatcher` defined on the document. MozReview-Commit-ID: I7T1LrMf8Ik
toolkit/content/macWindowMenu.js
--- a/toolkit/content/macWindowMenu.js
+++ b/toolkit/content/macWindowMenu.js
@@ -16,17 +16,17 @@ function macWindowMenuDidShow() {
     item.setAttribute("label", win.document.title);
     if (win == window) {
       item.setAttribute("checked", "true");
     }
     item.addEventListener("command", () => {
       if (win.windowState == window.STATE_MINIMIZED) {
         win.restore();
       }
-      win.document.commandDispatcher.focusedWindow.focus();
+      win.focus();
     });
     frag.appendChild(item);
   }
   document.getElementById("windowPopup").appendChild(frag);
 }
 
 function macWindowMenuDidHide() {
   let sep = document.getElementById("sep-window-list");