Skip to content

Commit e3f593a

Browse files
committed
cs_keyboard.py, main.js, and windowManager.js: Separate the keybindings and keyboard menu options for switching workspace up/down and toggling window/workspace selection
1 parent 3b89511 commit e3f593a

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
@@ -50,8 +50,8 @@
5050
KEYBINDINGS = [
5151
# KB Label Schema Key name Array? Category
5252
# General
53-
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "general"],
54-
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "general"],
53+
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-workspace-selection", "general"],
54+
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-window-selection", "general"],
5555
[_("Show desktop"), MUFFIN_KEYBINDINGS_SCHEMA, "show-desktop", "general"],
5656
[_("Show Desklets"), CINNAMON_SCHEMA, "show-desklets", "general"],
5757
[_("Cycle through open windows"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-windows", "general"],
@@ -119,6 +119,8 @@
119119
# Workspaces
120120
[_("Switch to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-left", "workspaces"],
121121
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right", "workspaces"],
122+
[_("Switch to up workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "workspaces"],
123+
[_("Switch to down workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "workspaces"],
122124
# Workspaces - Direct Nav
123125
[_("Switch to workspace 1"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-1", "ws-navi"],
124126
[_("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
@@ -1149,10 +1149,16 @@ function _stageEventHandler(actor, event) {
11491149
wm.actionMoveWorkspaceRight();
11501150
return true;
11511151
case Meta.KeyBindingAction.WORKSPACE_UP:
1152+
wm.actionMoveWorkspaceUp();
1153+
return true;
1154+
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1155+
wm.actionMoveWorkspaceDown();
1156+
return true;
1157+
case Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION:
11521158
overview.hide();
11531159
expo.hide();
11541160
return true;
1155-
case Meta.KeyBindingAction.WORKSPACE_DOWN:
1161+
case Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION:
11561162
overview.hide();
11571163
expo.hide();
11581164
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

@@ -1309,11 +1311,11 @@ var WindowManager = class WindowManager {
13091311

13101312
_showWorkspaceSwitcher(display, window, binding) {
13111313
let bindingName = binding.get_name();
1312-
if (bindingName === 'switch-to-workspace-up') {
1314+
if (bindingName === 'toggle-workspace-selection') {
13131315
Main.expo.toggle();
13141316
return;
13151317
}
1316-
if (bindingName === 'switch-to-workspace-down') {
1318+
if (bindingName === 'toggle-window-selection') {
13171319
Main.overview.toggle();
13181320
return;
13191321
}
@@ -1325,6 +1327,10 @@ var WindowManager = class WindowManager {
13251327
this.actionMoveWorkspaceLeft();
13261328
} else if (bindingName === 'switch-to-workspace-right') {
13271329
this.actionMoveWorkspaceRight();
1330+
} else if (bindingName === 'switch-to-workspace-up') {
1331+
this.actionMoveWorkspaceUp();
1332+
} else if (bindingName === 'switch-to-workspace-down') {
1333+
this.actionMoveWorkspaceDown();
13281334
}
13291335
}
13301336

0 commit comments

Comments
 (0)