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



commit f3e17df48376264671d114d20be3a14c5094b4f9
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 77a791c..3ac737f 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1315,7 +1315,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;
 
@@ -1356,7 +1355,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;
@@ -1616,11 +1614,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.
@@ -1731,7 +1724,6 @@ const MessageTray = new Lang.Class({
             this._trayLeftTimeoutId = 0;
             this._useLongerTrayLeftTimeout = false;
             this._pointerInTray = false;
-            this._pointerInSummary = false;
             this._updateNotificationTimeout(0);
             this._updateState();
         }
@@ -1741,7 +1733,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);
@@ -1767,7 +1758,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) &&
@@ -1794,21 +1785,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
@@ -1830,7 +1816,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]