Bug 876394 - Popup notification goes unnoticed in unfocused windows. r=gavin
authorDão Gottwald <dao@mozilla.com>
Thu, 30 May 2013 09:48:02 +0200
changeset 133409 6a090a8a76842e6a06c5fc993d71d7eef503e287
parent 133408 6af9d57973409b22c544ce45db3e37f07c568dd3
child 133410 fe83fd612679d6b9c5d83f2fd7d651c98d5bbf59
push id28752
push userdgottwald@mozilla.com
push dateThu, 30 May 2013 07:49:19 +0000
treeherdermozilla-inbound@6a090a8a7684 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs876394
milestone24.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 876394 - Popup notification goes unnoticed in unfocused windows. r=gavin
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -255,16 +255,23 @@ PopupNotifications.prototype = {
     let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
     if (browser == this.tabbrowser.selectedBrowser && fm.activeWindow == this.window) {
       // show panel now
       this._update(notification.anchorElement, true);
     } else {
       // Otherwise, update() will display the notification the next time the
       // relevant tab/window is selected.
 
+      // If the tab is selected but the window is in the background, let the OS
+      // tell the user that there's a notification waiting in that window.
+      // At some point we might want to do something about background tabs here
+      // too.
+      if (browser == this.tabbrowser.selectedBrowser)
+        this.window.getAttention();
+
       // Notify observers that we're not showing the popup (useful for testing)
       this._notify("backgroundShow");
     }
 
     return notification;
   },
 
   /**