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



commit 6ec06dc0c00c38a9ddd348c64ab11894e3cec659
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 40d5ee0..a7f1d8f 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1745,6 +1745,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) {
@@ -1987,7 +1992,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;
 
@@ -1995,7 +2000,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 4d16b71..23dad54 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -240,12 +240,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]