[gnome-shell/wip/message-tray: 19/21] messageTray: Don't hide the tray when we have a message incoming



commit b9b589d9dabdf9398d4b73fc142bc4e329ea91fd
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Aug 10 18:02:08 2012 -0300

    messageTray: Don't hide the tray when we have a message incoming
    
    Instead, pop up a message on top of it.

 js/ui/messageTray.js |   24 +++++-------------------
 1 files changed, 5 insertions(+), 19 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 832a4bb..4642d27 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1299,7 +1299,6 @@ const MessageTray = new Lang.Class({
         this._summary = new St.BoxLayout({ name: 'summary-mode',
                                            reactive: true,
                                            track_hover: true });
-        this._summary.connect('notify::hover', Lang.bind(this, this._onSummaryHoverChanged));
         this._summaryBin.child = this._summary;
         this._summaryBin.opacity = 0;
 
@@ -1340,7 +1339,6 @@ const MessageTray = new Lang.Class({
         this._pointerInTray = false;
         this._pointerInKeyboard = false;
         this._summaryState = State.HIDDEN;
-        this._pointerInSummary = false;
         this._notificationState = State.HIDDEN;
         this._notificationTimeoutId = 0;
         this._notificationExpandedId = 0;
@@ -1600,11 +1598,6 @@ const MessageTray = new Lang.Class({
         this._updateState();
     },
 
-    _onSummaryHoverChanged: function() {
-        this._pointerInSummary = this._summary.hover;
-        this._updateState();
-    },
-
     _onTrayHoverChanged: function() {
         if (this.actor.hover) {
             // Don't do anything if the one pixel area at the bottom is hovered over while the tray is hidden.
@@ -1715,7 +1708,6 @@ const MessageTray = new Lang.Class({
             this._trayLeftTimeoutId = 0;
             this._useLongerTrayLeftTimeout = false;
             this._pointerInTray = false;
-            this._pointerInSummary = false;
             this._updateNotificationTimeout(0);
             this._updateState();
         }
@@ -1725,7 +1717,6 @@ const MessageTray = new Lang.Class({
     _escapeTray: function() {
         this._unlock();
         this._pointerInTray = false;
-        this._pointerInSummary = false;
         this._traySummoned = false;
         this._setClickedSummaryItem(null);
         this._updateNotificationTimeout(0);
@@ -1751,7 +1742,7 @@ const MessageTray = new Lang.Class({
         let notificationsLimited = (this._busy || this._inFullscreen) && !this._isScreenLocked;
         let notificationsPending = notificationQueue.length > 0 && (!notificationsLimited || notificationUrgent);
         let nextNotification = notificationQueue.length > 0 ? notificationQueue[0] : null;
-        let notificationPinned = this._pointerInTray && !this._pointerInSummary && !this._notificationRemoved;
+        let notificationPinned = this._pointerInTray && !this._notificationRemoved;
         let notificationExpanded = this._notification && this._notification.expanded;
         let notificationExpired = this._notificationTimeoutId == 0 &&
                                   !(this._notification && this._notification.urgency == Urgency.CRITICAL) &&
@@ -1778,21 +1769,16 @@ const MessageTray = new Lang.Class({
         }
 
         // Summary
-        let summarySummoned = this._pointerInSummary || this._overviewVisible ||  this._traySummoned;
+        let summarySummoned = this._overviewVisible || this._traySummoned;
         let summaryPinned = this._pointerInTray || summarySummoned || this._locked;
-        let summaryHovered = this._pointerInTray || this._pointerInSummary;
 
         let notificationsVisible = (this._notificationState == State.SHOWING ||
                                     this._notificationState == State.SHOWN);
         let notificationsDone = !notificationsVisible && !notificationsPending;
 
-        let summaryOptionalInOverview = this._overviewVisible && !this._locked && !summaryHovered;
-        let mustHideSummary = (notificationsPending && (notificationUrgent || summaryOptionalInOverview))
-                              || notificationsVisible || this._isScreenLocked;
-
-        if (this._summaryState == State.HIDDEN && !mustHideSummary && summarySummoned)
+        if (this._summaryState == State.HIDDEN && summarySummoned)
             this._showSummary();
-        else if (this._summaryState == State.SHOWN && (!summaryPinned || mustHideSummary))
+        else if (this._summaryState == State.SHOWN && !summaryPinned)
             this._hideSummary();
 
         // Summary notification
@@ -1814,7 +1800,7 @@ const MessageTray = new Lang.Class({
             if (haveClickedSummaryItem && !summarySourceIsMainNotificationSource && canShowSummaryBoxPointer && !requestedNotificationStackIsEmpty)
                 this._showSummaryBoxPointer();
         } else if (this._summaryBoxPointerState == State.SHOWN) {
-            if (!haveClickedSummaryItem || !canShowSummaryBoxPointer || wrongSummaryBoxPointer || mustHideSummary) {
+            if (!haveClickedSummaryItem || !canShowSummaryBoxPointer || wrongSummaryBoxPointer) {
                 this._hideSummaryBoxPointer();
                 if (wrongSummaryBoxPointer)
                     this._showSummaryBoxPointer();



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