Skip to content

Commit b6d48e5

Browse files
committed
cs_keyboard.py, main.js, and windowManager.js: Separate the key bindings and keyboard menu options for switching workspace up/down and toggling window/workspace selection
1 parent dd290f1 commit b6d48e5

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

files/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
KEYBINDINGS = [
6767
# KB Label Schema Key name Array? Category
6868
# General
69-
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "general"],
70-
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "general"],
69+
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-workspace-selection", "general"],
70+
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-window-selection", "general"],
7171
[_("Show desktop"), MUFFIN_KEYBINDINGS_SCHEMA, "show-desktop", "general"],
7272
[_("Show Desklets"), CINNAMON_SCHEMA, "show-desklets", "general"],
7373
[_("Cycle through open windows"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-windows", "general"],
@@ -142,6 +142,8 @@
142142
# Workspaces
143143
[_("Switch to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-left", "workspaces"],
144144
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right", "workspaces"],
145+
[_("Switch to up workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "workspaces"],
146+
[_("Switch to down workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "workspaces"],
145147
# Workspaces - Direct Nav
146148
[_("Switch to workspace 1"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-1", "ws-navi"],
147149
[_("Switch to workspace 2"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-2", "ws-navi"],

js/ui/main.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,10 +1214,16 @@ function _stageEventHandler(actor, event) {
12141214
wm.actionMoveWorkspaceRight();
12151215
return true;
12161216
case Meta.KeyBindingAction.WORKSPACE_UP:
1217+
wm.actionMoveWorkspaceUp();
1218+
return true;
1219+
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1220+
wm.actionMoveWorkspaceDown();
1221+
return true;
1222+
case Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION:
12171223
overview.hide();
12181224
expo.hide();
12191225
return true;
1220-
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1226+
case Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION:
12211227
overview.hide();
12221228
expo.hide();
12231229
return true;

js/ui/windowManager.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ var WindowManager = class WindowManager {
361361
this._cinnamonwm.connect('filter-keybinding', this._filterKeybinding.bind(this));
362362
global.window_manager.connect('switch-workspace', (c, f, t, d) => this._switchWorkspace(c, f, t, d));
363363

364+
Meta.keybindings_set_custom_handler('toggle-window-selection', (d, w, b) => this._showWorkspaceSwitcher(d, w, b));
365+
Meta.keybindings_set_custom_handler('toggle-workspace-selection', (d, w, b) => this._showWorkspaceSwitcher(d, w, b));
364366
Meta.keybindings_set_custom_handler('move-to-workspace-left', (d, w, b) => this._moveWindowToWorkspaceLeft(d, w, b));
365367
Meta.keybindings_set_custom_handler('move-to-workspace-right', (d, w, b) => this._moveWindowToWorkspaceRight(d, w, b));
366368

@@ -1389,11 +1391,11 @@ var WindowManager = class WindowManager {
13891391

13901392
_showWorkspaceSwitcher(display, window, binding) {
13911393
let bindingName = binding.get_name();
1392-
if (bindingName === 'switch-to-workspace-up') {
1394+
if (bindingName === 'toggle-workspace-selection') {
13931395
Main.expo.toggle();
13941396
return;
13951397
}
1396-
if (bindingName === 'switch-to-workspace-down') {
1398+
if (bindingName === 'toggle-window-selection') {
13971399
Main.overview.toggle();
13981400
return;
13991401
}
@@ -1405,6 +1407,10 @@ var WindowManager = class WindowManager {
14051407
this.actionMoveWorkspaceLeft();
14061408
} else if (bindingName === 'switch-to-workspace-right') {
14071409
this.actionMoveWorkspaceRight();
1410+
} else if (bindingName === 'switch-to-workspace-up') {
1411+
this.actionMoveWorkspaceUp();
1412+
} else if (bindingName === 'switch-to-workspace-down') {
1413+
this.actionMoveWorkspaceDown();
14081414
}
14091415
}
14101416

0 commit comments

Comments
 (0)