[gnome-shell/wip/paging-release: 17/93] appDisplay:..We need the pan action commit before.. Fix click action outside folder pop up



commit 85b5e0b3ff79c0dfbface038a80bd4a64bf5f0eb
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Thu Jun 27 21:08:53 2013 +0200

    appDisplay:..We need the pan action commit before.. Fix click action outside folder pop up

 js/ui/appDisplay.js |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 39a73dc..b84eef0 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -287,6 +287,18 @@ const PaginationScrollView = new Lang.Class({
         }));
         this._panAction = panAction;
         this.add_action(panAction);
+        
+        this._clickAction = new Clutter.ClickAction();
+        this._clickAction.connect('clicked', Lang.bind(this, function() {
+            if (!this._currentPopup)
+                return;
+
+            let [x, y] = this._clickAction.get_coords();
+            let actor = global.stage.get_actor_at_pos(Clutter.PickMode.ALL, x, y);
+            if (!this._currentPopup.actor.contains(actor))
+                this._currentPopup.popdown();
+        }));
+        this._eventBlocker.add_action(this._clickAction);
     },
     
     vfunc_get_preferred_height: function (container, forWidht) {
@@ -420,6 +432,7 @@ const PaginationScrollView = new Lang.Class({
     },
     
     _onPan: function(action) {
+        this._clickAction.release();
         let [dist, dx, dy] = action.get_motion_delta(0);
         let adjustment = this.vscroll.adjustment;
         adjustment.value -= (dy / this.height) * adjustment.page_size;
@@ -638,7 +651,8 @@ const FrequentView = new Lang.Class({
                 continue;
             let appIcon = new AppIcon(mostUsed[i]);
             this._grid.addItem(appIcon.actor, -1);
-        }    }
+        }
+    }
 });
 
 const Views = {


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