[gnome-shell] messageTray: A variable to indicate that the close button was clicked



commit ec529287364cc40419bd0e69fc01aa585b940a45
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Sep 6 11:45:30 2012 +0200

    messageTray: A variable to indicate that the close button was clicked
    
    Otherwise critical resident notifications can not be closed by
    clicking the close button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683472

 js/ui/messageTray.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 329b74b..42ce76a 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1451,6 +1451,7 @@ const MessageTray = new Lang.Class({
         this._pointerInKeyboard = false;
         this._summaryState = State.HIDDEN;
         this._pointerInSummary = false;
+        this._notificationClosed = false;
         this._notificationState = State.HIDDEN;
         this._notificationTimeoutId = 0;
         this._notificationExpandedId = 0;
@@ -1547,9 +1548,13 @@ const MessageTray = new Lang.Class({
 
     _onCloseClicked: function() {
         if (this._notificationState == State.SHOWN) {
+            this._notificationClosed = true;
             this._notification.emit('done-displaying');
+
                 if (!this._notification.resident)
                     this._notification.destroy();
+
+            this._notificationClosed = false;
         }
     },
 
@@ -1913,7 +1918,7 @@ const MessageTray = new Lang.Class({
                                   !(this._pointerInKeyboard && notificationExpanded);
         let notificationLockedOut = this._isScreenLocked && (this._notification && !this._notification.showWhenLocked);
         // TODO: how to deal with locked out notiifcations if want to keep showing notifications?!
-        let notificationMustClose = this._notificationRemoved || notificationLockedOut || (notificationExpired && this._userActiveWhileNotificationShown);
+        let notificationMustClose = this._notificationRemoved || notificationLockedOut || (notificationExpired && this._userActiveWhileNotificationShown) || this._notificationClosed;
         let canShowNotification = notificationsPending && this._summaryState == State.HIDDEN;
 
         if (this._notificationState == State.HIDDEN) {



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