[gnome-shell/wip/garnacho/touchpad-gestures: 1/2] windowManager: refactor WorkspaceSwitchAction callback into separate function



commit 1575e6f83811c5fa928244c1758d59a751ca0d0d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Jul 1 15:51:15 2015 +0200

    windowManager: refactor WorkspaceSwitchAction callback into separate function
    
    This will be used too by the touchpad-specific "action", so put it in a
    shared place.

 js/ui/windowManager.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 5a86d5a..b020bf7 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -872,15 +872,18 @@ const WindowManager = new Lang.Class({
                                                 false, -1, 1);
 
         let gesture = new WorkspaceSwitchAction();
-        gesture.connect('activated', Lang.bind(this, function(action, direction) {
-            let newWs = global.screen.get_active_workspace().get_neighbor(direction);
-            this.actionMoveWorkspace(newWs);
-        }));
+        gesture.connect('activated', Lang.bind(this, this._actionSwitchWorkspace));
         global.stage.add_action(gesture);
 
         gesture = new AppSwitchAction();
         gesture.connect('activated', Lang.bind(this, this._switchApp));
         global.stage.add_action(gesture);
+
+    },
+
+    _actionSwitchWorkspace: function(action, direction) {
+            let newWs = global.screen.get_active_workspace().get_neighbor(direction);
+            this.actionMoveWorkspace(newWs);
     },
 
     _lookupIndex: function (windows, metaWindow) {


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