Bug 1357917 - Only hide doorhanger when navtoolbox autohides r=Gijs draft
authorDoug Thayer <dothayer@mozilla.com>
Wed, 24 May 2017 12:52:56 -0700
changeset 585149 79ef7bcaed08829ed64f444d8506e94329518902
parent 583750 e84acaf49a8f5032864a2602c1c61b68ceb1b773
child 630645 9776e2d584ef883c3b3fa895bcc0ccb5fc2ac92b
push id61026
push userbmo:dothayer@mozilla.com
push dateFri, 26 May 2017 16:18:43 +0000
reviewersGijs
bugs1357917, 1368094
milestone55.0a1
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
browser/components/customizableui/content/panelUI.inc.xul
browser/components/customizableui/content/panelUI.js
browser/components/customizableui/test/browser.ini
--- 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]