Bug 1194706: make sure that the notification icons and doorhangers are shown in undocked chat windows too. r=Mossop
☠☠ backed out by 36f736832b9f ☠ ☠
authorMike de Boer <mdeboer@mozilla.com>
Fri, 02 Oct 2015 11:25:03 +0200
changeset 265790 36cdf3559c3bea98a414e2f66916b2a5f496d9f5
parent 265789 bde12ec5cd8aaf4db486179c43f46a97e99d49ec
child 265791 f9ded6b0a3ee8467c650392c6ddcf46f2ab2852e
push id66032
push userkwierso@gmail.com
push dateFri, 02 Oct 2015 20:43:24 +0000
treeherdermozilla-inbound@03e8acfc181f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1194706
milestone44.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 1194706: make sure that the notification icons and doorhangers are shown in undocked chat windows too. r=Mossop
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -686,38 +686,42 @@ PopupNotifications.prototype = {
    *                       currently displayed notifications will be left alone.
    */
   _update: function PopupNotifications_update(notifications, anchors = new Set(), dismissShowing = false) {
     if (anchors instanceof Ci.nsIDOMXULElement)
       anchors = new Set([anchors]);
 
     if (!notifications)
       notifications = this._currentNotifications;
-    let notificationsToShow = [];
-    // Filter out notifications that have been dismissed.
-    notificationsToShow = notifications.filter(function (n) {
-      return !n.dismissed && !n.options.neverShow;
-    });
 
-    if (!anchors.size && notificationsToShow.length)
-      anchors = this._getAnchorsForNotifications(notificationsToShow);
+    if (!anchors.size && notifications.length)
+      anchors = this._getAnchorsForNotifications(notifications);
 
     let useIconBox = !!this.iconBox;
     if (useIconBox && anchors.size) {
       for (let anchor of anchors) {
         if (anchor.parentNode == this.iconBox)
           continue;
         useIconBox = false;
         break;
       }
     }
 
+    let notificationsToShow = [];
+    // Filter out notifications that have been dismissed.
+    notificationsToShow = notifications.filter(function (n) {
+      return !n.dismissed && !n.options.neverShow;
+    });
+
     if (useIconBox) {
-      // hide icons of the previous tab.
+      // Hide icons of the previous tab.
       this._hideIcons();
+      // Make sure that panels can only be attached to anchors of shown
+      // notifications inside an iconBox.
+      anchors = this._getAnchorsForNotifications(notificationsToShow);
     }
 
     let haveNotifications = notifications.length > 0;
     if (haveNotifications) {
       if (useIconBox) {
         this._showIcons(notifications);
         this.iconBox.hidden = false;
       } else if (anchors.size) {