Skip to content

Commit 74c282e

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 4af7ab3 commit 74c282e

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Diff for: files/usr/share/cinnamon/cinnamon-settings/modules/cs_keyboard.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
KEYBINDINGS = [
5050
# KB Label Schema Key name Array? Category
5151
# General
52-
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "general"],
53-
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "general"],
52+
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-workspace-selection", "general"],
53+
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-window-selection", "general"],
5454
[_("Show desktop"), MUFFIN_KEYBINDINGS_SCHEMA, "show-desktop", "general"],
5555
[_("Show Desklets"), CINNAMON_SCHEMA, "show-desklets", "general"],
5656
[_("Cycle through open windows"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-windows", "general"],
@@ -122,6 +122,8 @@
122122
# Workspaces
123123
[_("Switch to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-left", "workspaces"],
124124
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right", "workspaces"],
125+
[_("Switch to up workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "workspaces"],
126+
[_("Switch to down workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "workspaces"],
125127
# Workspaces - Direct Nav
126128
[_("Switch to workspace 1"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-1", "ws-navi"],
127129
[_("Switch to workspace 2"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-2", "ws-navi"],

Diff for: js/ui/main.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1134,10 +1134,16 @@ function _stageEventHandler(actor, event) {
11341134
wm.actionMoveWorkspaceRight();
11351135
return true;
11361136
case Meta.KeyBindingAction.WORKSPACE_UP:
1137+
wm.actionMoveWorkspaceUp();
1138+
return true;
1139+
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1140+
wm.actionMoveWorkspaceDown();
1141+
return true;
1142+
case Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION:
11371143
overview.hide();
11381144
expo.hide();
11391145
return true;
1140-
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1146+
case Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION:
11411147
overview.hide();
11421148
expo.hide();
11431149
return true;

Diff for: js/ui/windowManager.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ var WindowManager = class WindowManager {
285285
this._cinnamonwm.connect('filter-keybinding', this._filterKeybinding.bind(this));
286286
global.window_manager.connect('switch-workspace', (c, f, t, d) => this._switchWorkspace(c, f, t, d));
287287

288+
Meta.keybindings_set_custom_handler('toggle-window-selection', (d, w, b) => this._showWorkspaceSwitcher(d, w, b));
289+
Meta.keybindings_set_custom_handler('toggle-workspace-selection', (d, w, b) => this._showWorkspaceSwitcher(d, w, b));
288290
Meta.keybindings_set_custom_handler('move-to-workspace-left', (d, w, b) => this._moveWindowToWorkspaceLeft(d, w, b));
289291
Meta.keybindings_set_custom_handler('move-to-workspace-right', (d, w, b) => this._moveWindowToWorkspaceRight(d, w, b));
290292

@@ -1338,11 +1340,11 @@ var WindowManager = class WindowManager {
13381340

13391341
_showWorkspaceSwitcher(display, window, binding) {
13401342
let bindingName = binding.get_name();
1341-
if (bindingName === 'switch-to-workspace-up') {
1343+
if (bindingName === 'toggle-workspace-selection') {
13421344
Main.expo.toggle();
13431345
return;
13441346
}
1345-
if (bindingName === 'switch-to-workspace-down') {
1347+
if (bindingName === 'toggle-window-selection') {
13461348
Main.overview.toggle();
13471349
return;
13481350
}
@@ -1354,6 +1356,10 @@ var WindowManager = class WindowManager {
13541356
this.actionMoveWorkspaceLeft();
13551357
} else if (bindingName === 'switch-to-workspace-right') {
13561358
this.actionMoveWorkspaceRight();
1359+
} else if (bindingName === 'switch-to-workspace-up') {
1360+
this.actionMoveWorkspaceUp();
1361+
} else if (bindingName === 'switch-to-workspace-down') {
1362+
this.actionMoveWorkspaceDown();
13571363
}
13581364
}
13591365

0 commit comments

Comments
 (0)