Bug 1353980 - Don't try to hide popup notifications in fullscreen mode. r=Paolo
MozReview-Commit-ID: 5VWHooAIMRT
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -254,16 +254,27 @@ this.PopupNotifications = function Popup
activeElement == this.tabbrowser.selectedBrowser ||
// Ignore focused elements inside the notification.
getNotificationFromElement(activeElement) == notification ||
notification.contains(activeElement)) {
this._onButtonEvent(aEvent, "secondarybuttoncommand", notification);
}
};
+ // There are no anchor icons in DOM fullscreen mode, but we would
+ // still like to show the popup notification. To avoid an infinite
+ // loop of showing and hiding, we have to disable followanchor
+ // (which hides the element without an anchor) in fullscreen.
+ this.window.addEventListener("MozDOMFullscreen:Entered", () => {
+ this.panel.setAttribute("followanchor", "false");
+ }, true);
+ this.window.addEventListener("MozDOMFullscreen:Exited", () => {
+ this.panel.setAttribute("followanchor", "true");
+ }, true);
+
this.window.addEventListener("activate", this, true);
if (this.tabbrowser.tabContainer)
this.tabbrowser.tabContainer.addEventListener("TabSelect", this, true);
}
PopupNotifications.prototype = {
window: null,