From abd0ac2cc3aeafb8f055bd58943c81ba4a7f5e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 17 Apr 2014 16:54:37 +0200 Subject: [PATCH] keybindings: Handle switch-to-workspace-{up,down,left,right} again Commit 585fdd781cc5 not only removed the tabpopup, but set invalid handlers (a.k.a. NULL) for those shortcuts; add back handling of basic handling of those shortcuts by switching instantly without any popups. https://bugzilla.gnome.org/show_bug.cgi?id=728423 --- src/core/keybindings.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index cc9b09b8e..19376e4f9 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -2475,7 +2475,19 @@ handle_switch_to_workspace (MetaDisplay *display, gint which = binding->handler->data; MetaWorkspace *workspace; - workspace = meta_screen_get_workspace_by_index (screen, which); + if (which < 0) + { + /* Negative workspace numbers are directions with respect to the + * current workspace. + */ + + workspace = meta_workspace_get_neighbor (screen->active_workspace, + which); + } + else + { + workspace = meta_screen_get_workspace_by_index (screen, which); + } if (workspace) { @@ -3350,28 +3362,28 @@ init_builtin_key_bindings (MetaDisplay *display) common_keybindings, META_KEY_BINDING_NONE, META_KEYBINDING_ACTION_WORKSPACE_LEFT, - NULL, 0); + handle_switch_to_workspace, META_MOTION_LEFT); add_builtin_keybinding (display, "switch-to-workspace-right", common_keybindings, META_KEY_BINDING_NONE, META_KEYBINDING_ACTION_WORKSPACE_RIGHT, - NULL, 0); + handle_switch_to_workspace, META_MOTION_RIGHT); add_builtin_keybinding (display, "switch-to-workspace-up", common_keybindings, META_KEY_BINDING_NONE, META_KEYBINDING_ACTION_WORKSPACE_UP, - NULL, 0); + handle_switch_to_workspace, META_MOTION_UP); add_builtin_keybinding (display, "switch-to-workspace-down", common_keybindings, META_KEY_BINDING_NONE, META_KEYBINDING_ACTION_WORKSPACE_DOWN, - NULL, 0); + handle_switch_to_workspace, META_MOTION_DOWN); add_builtin_keybinding (display, "switch-to-workspace-last",