From 247a42ccc49a7b4aa374dabea0f5b32006eb84b6 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 25 Jun 2014 18:13:26 +0200 Subject: [PATCH] windowManager: switch workspaces on 4-finger drag The workspace to switch is obtained from the direction received by the WorkspaceSwitchAction gesture. --- js/ui/windowManager.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 431deb16c..b02e93d1f 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -11,6 +11,7 @@ const St = imports.gi.St; const Shell = imports.gi.Shell; const AltTab = imports.ui.altTab; +const WorkspaceSwitchAction = imports.ui.workspaceSwitchAction; const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup; const Main = imports.ui.main; const ModalDialog = imports.ui.modalDialog; @@ -683,6 +684,13 @@ const WindowManager = new Lang.Class({ global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1); + + let gesture = new WorkspaceSwitchAction.WorkspaceSwitchAction(); + gesture.connect('activated', Lang.bind(this, function(action, direction) { + let newWs = global.screen.get_active_workspace().get_neighbor(direction); + this.actionMoveWorkspace(newWs); + })); + global.stage.add_action(gesture); }, keepWorkspaceAlive: function(workspace, duration) {