Bug 1454440 - Focus the window directly instead of using commandDispatcher in the mac Window menu;r=Gijs
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 16 Apr 2018 11:05:01 -0700
changeset 413948 32220a5b1ba8827b89a099b1c7ebd02a88e18241
parent 413947 229be2ad5ee3a60ddc31568792725bee2a6564dc
child 413949 77694987ba61cf176fc403badc29431158f3f831
push id33853
push usercbrindusan@mozilla.com
push dateTue, 17 Apr 2018 09:51:13 +0000
treeherdermozilla-central@8b0ba3f7d099 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1454440
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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");