Bug 1357917 - Only hide doorhanger when navtoolbox autohides r=Gijs
On OSX we want to show doorhangers when in fullscreen, since OSX
fullscreen doesn't hide the nav toolbox. This makes that change,
and also adds flip="slide" to the panel so that the arrow adjusts
correctly. Unfortunately there still seems to be a bit of a
problem with this where the doorhanger adjusts its position when
entering fullscreen but then waits a little bit (not sure what
triggers it) before updating the anchor arrow. This is tracked by
Bug 1368094.
MozReview-Commit-ID: 3dRLwgMjxIb
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -426,16 +426,17 @@
oncommand="PanicButtonNotifier.close()"/>
</panel>
<panel id="appMenu-notification-popup"
class="popup-notification-panel"
type="arrow"
position="after_start"
hidden="true"
+ flip="slide"
orient="vertical"
noautofocus="true"
noautohide="true"
nopreventnavboxhide="true"
role="alert">
<popupnotification id="appMenu-update-available-notification"
popupid="update-available"
label="&updateAvailable.header.message;"
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -683,17 +683,17 @@ const PanelUI = {
if (!notifications || !notifications.length) {
if (notificationsChanged) {
this._clearAllNotifications();
this._hidePopup();
}
return;
}
- if (window.fullScreen && FullScreen.navToolboxHidden) {
+ if ((window.fullScreen && FullScreen.navToolboxHidden) || document.fullscreenElement) {
this._hidePopup();
return;
}
let doorhangers =
notifications.filter(n => !n.dismissed && !n.options.badgeOnly);
if (this.panel.state == "showing" || this.panel.state == "open") {
@@ -701,18 +701,20 @@ const PanelUI = {
// since we don't want their doorhangers competing for attention
doorhangers.forEach(n => { n.dismissed = true; })
this._hidePopup();
this._clearBadge();
if (!notifications[0].options.badgeOnly) {
this._showBannerItem(notifications[0]);
}
} else if (doorhangers.length > 0) {
+ let autoHideFullScreen = Services.prefs.getBoolPref("browser.fullscreen.autohide", false) &&
+ Services.appinfo.OS !== "Darwin";
// Only show the doorhanger if the window is focused and not fullscreen
- if (window.fullScreen || Services.focus.activeWindow !== window) {
+ if ((window.fullScreen && autoHideFullScreen) || Services.focus.activeWindow !== window) {
this._hidePopup();
this._showBadge(doorhangers[0]);
this._showBannerItem(doorhangers[0]);
} else {
this._clearBadge();
this._showNotificationPanel(doorhangers[0]);
}
} else {
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -147,15 +147,17 @@ skip-if = os == "mac"
[browser_1161838_inserted_new_default_buttons.js]
[browser_bootstrapped_custom_toolbar.js]
[browser_customizemode_contextmenu_menubuttonstate.js]
[browser_exit_background_customize_mode.js]
[browser_overflow_use_subviews.js]
[browser_panel_toggle.js]
[browser_panelUINotifications.js]
[browser_panelUINotifications_fullscreen.js]
+tags = fullscreen
+skip-if = os == "mac"
[browser_panelUINotifications_multiWindow.js]
[browser_switch_to_customize_mode.js]
[browser_synced_tabs_menu.js]
[browser_check_tooltips_in_navbar.js]
[browser_editcontrols_update.js]
subsuite = clipboard
[browser_remote_tabs_button.js]