Skip to content

Commit a105346

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 3724d7a commit a105346

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
@@ -64,8 +64,8 @@
6464
KEYBINDINGS = [
6565
# KB Label Schema Key name Array? Category
6666
# General
67-
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "general"],
68-
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "general"],
67+
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-workspace-selection", "general"],
68+
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-window-selection", "general"],
6969
[_("Show desktop"), MUFFIN_KEYBINDINGS_SCHEMA, "show-desktop", "general"],
7070
[_("Show Desklets"), CINNAMON_SCHEMA, "show-desklets", "general"],
7171
[_("Cycle through open windows"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-windows", "general"],
@@ -140,6 +140,8 @@
140140
# Workspaces
141141
[_("Switch to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-left", "workspaces"],
142142
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right", "workspaces"],
143+
[_("Switch to up workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "workspaces"],
144+
[_("Switch to down workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "workspaces"],
143145
# Workspaces - Direct Nav
144146
[_("Switch to workspace 1"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-1", "ws-navi"],
145147
[_("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
@@ -1175,10 +1175,16 @@ function _stageEventHandler(actor, event) {
11751175
wm.actionMoveWorkspaceRight();
11761176
return true;
11771177
case Meta.KeyBindingAction.WORKSPACE_UP:
1178+
wm.actionMoveWorkspaceUp();
1179+
return true;
1180+
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1181+
wm.actionMoveWorkspaceDown();
1182+
return true;
1183+
case Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION:
11781184
overview.hide();
11791185
expo.hide();
11801186
return true;
1181-
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1187+
case Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION:
11821188
overview.hide();
11831189
expo.hide();
11841190
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

@@ -1390,11 +1392,11 @@ var WindowManager = class WindowManager {
13901392

13911393
_showWorkspaceSwitcher(display, window, binding) {
13921394
let bindingName = binding.get_name();
1393-
if (bindingName === 'switch-to-workspace-up') {
1395+
if (bindingName === 'toggle-workspace-selection') {
13941396
Main.expo.toggle();
13951397
return;
13961398
}
1397-
if (bindingName === 'switch-to-workspace-down') {
1399+
if (bindingName === 'toggle-window-selection') {
13981400
Main.overview.toggle();
13991401
return;
14001402
}
@@ -1406,6 +1408,10 @@ var WindowManager = class WindowManager {
14061408
this.actionMoveWorkspaceLeft();
14071409
} else if (bindingName === 'switch-to-workspace-right') {
14081410
this.actionMoveWorkspaceRight();
1411+
} else if (bindingName === 'switch-to-workspace-up') {
1412+
this.actionMoveWorkspaceUp();
1413+
} else if (bindingName === 'switch-to-workspace-down') {
1414+
this.actionMoveWorkspaceDown();
14091415
}
14101416
}
14111417

0 commit comments

Comments
 (0)