[gnome-shell] messageTray: Use the bottom monitor's fullscreen state for rate limiting



commit 725a36e37accc731189238550e15faa235e71b1d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Mar 11 15:57:32 2013 -0400

    messageTray: Use the bottom monitor's fullscreen state for rate limiting
    
    It makes more sense to use the monitor the tray is on, rather than the
    primary monitor. This also matches us with whether we can open the tray
    from a barrier/dwell or not.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695659

 js/ui/layout.js      |    3 ++-
 js/ui/messageTray.js |    9 ++-------
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/layout.js b/js/ui/layout.js
index 381676d..4ca2680 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -976,8 +976,9 @@ const LayoutManager = new Lang.Class({
                     !metaWindow.appears_focused)
                     metaWindow.minimize();
             }
-            this.emit('primary-fullscreen-changed', this.primaryMonitor.inFullscreen);
         }
+
+        this.emit('fullscreen-changed');
     },
 
     _updateRegions: function() {
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 0b1b502..1f4c555 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1670,7 +1670,7 @@ const MessageTray = new Lang.Class({
         Main.layoutManager.trackChrome(this._notificationWidget);
         Main.layoutManager.trackChrome(this._closeButton);
 
-        Main.layoutManager.connect('primary-fullscreen-changed', Lang.bind(this, this._onFullscreenChanged));
+        Main.layoutManager.connect('fullscreen-changed', Lang.bind(this, this._updateState));
         Main.layoutManager.connect('hot-corners-changed', Lang.bind(this, this._hotCornersChanged));
 
         // If the overview shows or hides while we're in
@@ -2169,11 +2169,6 @@ const MessageTray = new Lang.Class({
         this._updateState();
     },
 
-    _onFullscreenChanged: function(obj, state) {
-        this._inFullscreen = state;
-        this._updateState();
-    },
-
     _onStatusChanged: function(status) {
         if (status == GnomeSession.PresenceStatus.BUSY) {
             // remove notification and allow the summary to be closed now
@@ -2232,7 +2227,7 @@ const MessageTray = new Lang.Class({
         let notificationQueue = this._notificationQueue;
         let notificationUrgent = notificationQueue.length > 0 && notificationQueue[0].urgency == 
Urgency.CRITICAL;
         let notificationForFeedback = notificationQueue.length > 0 && notificationQueue[0].forFeedback;
-        let notificationsLimited = this._busy || this._inFullscreen;
+        let notificationsLimited = this._busy || Main.layoutManager.bottomMonitor.inFullscreen;
         let notificationsPending = notificationQueue.length > 0 && (!notificationsLimited || 
notificationUrgent || notificationForFeedback) && Main.sessionMode.hasNotifications;
         let nextNotification = notificationQueue.length > 0 ? notificationQueue[0] : null;
         let notificationPinned = this._pointerInTray && !this._pointerInSummary && 
!this._notificationRemoved;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]