Skip to content

Commit 2de831f

Browse files
rcalixtemtwebster
authored andcommitted
cs_keyboard.py, main.js, and KeybindingTable.py: Separate the key bindings and keyboard menu options for switching workspace up/down and toggling window/workspace selection
1 parent d75d528 commit 2de831f

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

files/usr/share/cinnamon/cinnamon-settings/bin/KeybindingTable.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@
172172
],
173173
[
174174
[_("Switch to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-left"],
175-
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right"]
175+
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right"],
176+
[_("Switch to up workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up"],
177+
[_("Switch to down workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down"]
176178
]
177179
],
178180
[_("System"), "system", None, "xsi-emblem-system-symbolic",
@@ -976,4 +978,4 @@ def get_default():
976978
global instance
977979
if instance is None:
978980
instance = KeybindingTable()
979-
return instance
981+
return instance

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
MASKS = [Gdk.ModifierType.CONTROL_MASK, Gdk.ModifierType.MOD1_MASK,
2626
Gdk.ModifierType.SHIFT_MASK, Gdk.ModifierType.SUPER_MASK]
2727

28+
2829
class Module:
2930
comment = _("Manage keyboard settings and shortcuts")
3031
name = "keyboard"

js/ui/windowManager.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,10 @@ var WindowManager = class WindowManager {
366366
(d, w, b) => this._moveWindowToWorkspaceLeft(d, w, b), Cinnamon.ActionMode.NORMAL);
367367
kbm.setBuiltinHandler('move-to-workspace-right', Meta.KeyBindingAction.MOVE_TO_WORKSPACE_RIGHT,
368368
(d, w, b) => this._moveWindowToWorkspaceRight(d, w, b), Cinnamon.ActionMode.NORMAL);
369-
369+
kbm.setBuiltinHandler('toggle-window-selection', Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION,
370+
(d, w, b) => this._showWorkspaceSwitcher(d, w, b), WORKSPACE_MODES);
371+
kbm.setBuiltinHandler('toggle-workspace-selection', Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION,
372+
(d, w, b) => this._showWorkspaceSwitcher(d, w, b), WORKSPACE_MODES);
370373
kbm.setBuiltinHandler('switch-to-workspace-left', Meta.KeyBindingAction.WORKSPACE_LEFT,
371374
(d, w, b) => this._showWorkspaceSwitcher(d, w, b), WORKSPACE_MODES);
372375
kbm.setBuiltinHandler('switch-to-workspace-right', Meta.KeyBindingAction.WORKSPACE_RIGHT,
@@ -1394,7 +1397,7 @@ var WindowManager = class WindowManager {
13941397
_showWorkspaceSwitcher(display, window, binding) {
13951398
let bindingName = binding.get_name();
13961399

1397-
if (bindingName === 'switch-to-workspace-up') {
1400+
if (bindingName === 'toggle-workspace-selection') {
13981401
if (Main.overview.visible || Main.expo.visible) {
13991402
Main.overview.hide();
14001403
Main.expo.hide();
@@ -1403,7 +1406,7 @@ var WindowManager = class WindowManager {
14031406
}
14041407
return;
14051408
}
1406-
if (bindingName === 'switch-to-workspace-down') {
1409+
if (bindingName === 'toggle-window-selection') {
14071410
if (Main.overview.visible || Main.expo.visible) {
14081411
Main.overview.hide();
14091412
Main.expo.hide();
@@ -1420,6 +1423,10 @@ var WindowManager = class WindowManager {
14201423
this.actionMoveWorkspaceLeft();
14211424
} else if (bindingName === 'switch-to-workspace-right') {
14221425
this.actionMoveWorkspaceRight();
1426+
} else if (bindingName === 'switch-to-workspace-up') {
1427+
this.actionMoveWorkspaceUp();
1428+
} else if (bindingName === 'switch-to-workspace-down') {
1429+
this.actionMoveWorkspaceDown();
14231430
}
14241431
}
14251432

0 commit comments

Comments
 (0)