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 467481 32220a5b1ba8827b89a099b1c7ebd02a88e18241
parent 467480 229be2ad5ee3a60ddc31568792725bee2a6564dc
child 467482 77694987ba61cf176fc403badc29431158f3f831
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [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");