[gnome-shell/wip/message-tray: 20/23] messageTray: Close the current box pointer when clicking on the same item



commit 20a12ccefc3e69c7a509e25d137162d796a8717d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Aug 16 13:54:03 2012 -0400

    messageTray: Close the current box pointer when clicking on the same item

 js/ui/messageTray.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index 655e67c..3151d6a 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -1640,7 +1640,8 @@ const MessageTray = new Lang.Class({
         if (summaryItem.source.handleSummaryClick()) {
             this._setClickedSummaryItem(null);
         } else {
-            this._setClickedSummaryItem(summaryItem, button);
+            if (!this._setClickedSummaryItem(summaryItem, button))
+                this._setClickedSummaryItem(null);
         }
 
         this._updateState();
@@ -2251,7 +2252,7 @@ const MessageTray = new Lang.Class({
     _setClickedSummaryItem: function(item, button) {
         if (item == this._clickedSummaryItem &&
             button == this._clickedSummaryItemMouseButton)
-            return;
+            return false;
 
         if (this._clickedSummaryItem) {
             this._clickedSummaryItem.actor.remove_style_pseudo_class('selected');
@@ -2278,6 +2279,8 @@ const MessageTray = new Lang.Class({
             this._trayMotionId = Main.layoutManager.trayBox.connect('notify::anchor-y',
                                                                     Lang.bind(this, this._adjustSummaryBoxPointerPosition));
         }
+
+        return true;
     },
 
     _onSummaryBoxPointerUngrabbed: function() {



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