Skip to content

Commit b68ad06

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 1800d4b commit b68ad06

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
@@ -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"],

Diff for: js/ui/main.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1163,10 +1163,16 @@ function _stageEventHandler(actor, event) {
11631163
wm.actionMoveWorkspaceRight();
11641164
return true;
11651165
case Meta.KeyBindingAction.WORKSPACE_UP:
1166+
wm.actionMoveWorkspaceUp();
1167+
return true;
1168+
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1169+
wm.actionMoveWorkspaceDown();
1170+
return true;
1171+
case Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION:
11661172
overview.hide();
11671173
expo.hide();
11681174
return true;
1169-
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1175+
case Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION:
11701176
overview.hide();
11711177
expo.hide();
11721178
return true;

Diff for: js/ui/windowManager.js

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

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

@@ -1337,11 +1339,11 @@ var WindowManager = class WindowManager {
13371339

13381340
_showWorkspaceSwitcher(display, window, binding) {
13391341
let bindingName = binding.get_name();
1340-
if (bindingName === 'switch-to-workspace-up') {
1342+
if (bindingName === 'toggle-workspace-selection') {
13411343
Main.expo.toggle();
13421344
return;
13431345
}
1344-
if (bindingName === 'switch-to-workspace-down') {
1346+
if (bindingName === 'toggle-window-selection') {
13451347
Main.overview.toggle();
13461348
return;
13471349
}
@@ -1353,6 +1355,10 @@ var WindowManager = class WindowManager {
13531355
this.actionMoveWorkspaceLeft();
13541356
} else if (bindingName === 'switch-to-workspace-right') {
13551357
this.actionMoveWorkspaceRight();
1358+
} else if (bindingName === 'switch-to-workspace-up') {
1359+
this.actionMoveWorkspaceUp();
1360+
} else if (bindingName === 'switch-to-workspace-down') {
1361+
this.actionMoveWorkspaceDown();
13561362
}
13571363
}
13581364

0 commit comments

Comments
 (0)