diff --git a/browser/modules/UITour.jsm b/browser/modules/UITour.jsm index edaf4b5b3fb7..9f4e8c92eec0 100644 --- a/browser/modules/UITour.jsm +++ b/browser/modules/UITour.jsm @@ -422,6 +422,7 @@ this.UITour = { this.hideHighlight(aWindow); this.hideInfo(aWindow); aWindow.PanelUI.panel.removeAttribute("noautohide"); + this.recreatePopup(aWindow.PanelUI.panel); } this.endUrlbarCapture(aWindow); @@ -822,6 +823,10 @@ this.UITour = { if (aMenuName == "appMenu") { aWindow.PanelUI.panel.setAttribute("noautohide", "true"); + // If the popup is already opened, don't recreate the widget as it may cause a flicker. + if (aWindow.PanelUI.panel.state != "open") { + this.recreatePopup(aWindow.PanelUI.panel); + } aWindow.PanelUI.panel.addEventListener("popuphiding", this.hidePanelAnnotations); aWindow.PanelUI.panel.addEventListener("ViewShowing", this.hidePanelAnnotations); if (aOpenCallback) { @@ -843,6 +848,7 @@ this.UITour = { if (aMenuName == "appMenu") { aWindow.PanelUI.panel.removeAttribute("noautohide"); aWindow.PanelUI.hide(); + this.recreatePopup(aWindow.PanelUI.panel); } else if (aMenuName == "bookmarks") { closeMenuButton("bookmarks-menu-button"); } @@ -873,6 +879,14 @@ this.UITour = { UITour.appMenuOpenForAnnotation.clear(); }, + recreatePopup: function(aPanel) { + // After changing popup attributes that relate to how the native widget is created + // (e.g. @noautohide) we need to re-create the frame/widget for it to take effect. + aPanel.hidden = true; + aPanel.clientWidth; // flush + aPanel.hidden = false; + }, + startUrlbarCapture: function(aWindow, aExpectedText, aUrl) { let urlbar = aWindow.document.getElementById("urlbar"); this.urlbarCapture.set(aWindow, {