[gnome-shell/wip/re-search: 145/151] messageTray, viewSelector: show/hide message tray on search signals



commit 4590b33f2ed1f2d6cdbc7417171fdfa11c9ba7ca
Author: Tanner Doshier <doshitan gmail com>
Date:   Thu Aug 16 18:26:10 2012 -0500

    messageTray, viewSelector: show/hide message tray on search signals
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682050

 js/ui/messageTray.js |    9 +++++++--
 js/ui/overview.js    |    8 ++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 20358e1..2b58426 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1736,6 +1736,11 @@ const MessageTray = new Lang.Class({
         this._updateState();
     },
 
+    show: function() {
+        this._traySummoned = true;
+        this._updateState();
+    },
+
     _onNotify: function(source, notification) {
         if (this._summaryBoxPointerItem && this._summaryBoxPointerItem.source == source) {
             if (this._summaryBoxPointerState == State.HIDING) {
@@ -1978,7 +1983,7 @@ const MessageTray = new Lang.Class({
         }
 
         // Summary
-        let summarySummoned = this._pointerInSummary || this._overviewVisible ||  this._traySummoned;
+        let summarySummoned = this._pointerInSummary ||  this._traySummoned;
         let summaryPinned = this._pointerInTray || summarySummoned || this._locked;
         let summaryHovered = this._pointerInTray || this._pointerInSummary;
 
@@ -1986,7 +1991,7 @@ const MessageTray = new Lang.Class({
                                     this._notificationState == State.SHOWN);
         let notificationsDone = !notificationsVisible && !notificationsPending;
 
-        let summaryOptionalInOverview = this._overviewVisible && !this._locked && !summaryHovered;
+        let summaryOptionalInOverview = !this._locked && !summaryHovered;
         let mustHideSummary = (notificationsPending && (notificationUrgent || summaryOptionalInOverview))
                               || notificationsVisible || !Main.sessionMode.hasNotifications;
 
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 629da01..bfe0472 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -244,12 +244,20 @@ const Overview = new Lang.Class({
                 this.searchActive = true;
                 this._dash.hide();
                 this._thumbnailsBox.hide();
+                Main.messageTray.hide();
             }));
         this._viewSelector.connect('search-cancelled', Lang.bind(this,
             function() {
                 this.searchActive = false;
                 this._dash.show();
                 this._thumbnailsBox.show();
+                // search-cancelled is emitted if we leave the overview
+                // directly from searching. That means the message tray will
+                // be shown when we reach the workspace. Don't do this, only
+                // show the message tray on search-cancelled if we are still
+                // in the overview/not transitioning out of it.
+                if (this.visible && !this.animationInProgress)
+                    Main.messageTray.show();
             }));
 
         this.connect('app-drag-begin',



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