Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Next] 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 #10989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
KEYBINDINGS = [
# KB Label Schema Key name Array? Category
# General
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "general"],
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "general"],
[_("Show the workspace selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-workspace-selection", "general"],
[_("Show the window selection screen"), MUFFIN_KEYBINDINGS_SCHEMA, "toggle-window-selection", "general"],
[_("Show desktop"), MUFFIN_KEYBINDINGS_SCHEMA, "show-desktop", "general"],
[_("Show Desklets"), CINNAMON_SCHEMA, "show-desklets", "general"],
[_("Cycle through open windows"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-windows", "general"],
Expand Down Expand Up @@ -140,6 +140,8 @@
# Workspaces
[_("Switch to left workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-left", "workspaces"],
[_("Switch to right workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-right", "workspaces"],
[_("Switch to up workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-up", "workspaces"],
[_("Switch to down workspace"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-down", "workspaces"],
# Workspaces - Direct Nav
[_("Switch to workspace 1"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-1", "ws-navi"],
[_("Switch to workspace 2"), MUFFIN_KEYBINDINGS_SCHEMA, "switch-to-workspace-2", "ws-navi"],
Expand Down
8 changes: 7 additions & 1 deletion js/ui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1175,10 +1175,16 @@ function _stageEventHandler(actor, event) {
wm.actionMoveWorkspaceRight();
return true;
case Meta.KeyBindingAction.WORKSPACE_UP:
wm.actionMoveWorkspaceUp();
return true;
case Meta.KeyBindingAction.WORKSPACE_DOWN:
wm.actionMoveWorkspaceDown();
return true;
case Meta.KeyBindingAction.TOGGLE_WORKSPACE_SELECTION:
overview.hide();
expo.hide();
return true;
case Meta.KeyBindingAction.WORKSPACE_DOWN:
case Meta.KeyBindingAction.TOGGLE_WINDOW_SELECTION:
overview.hide();
expo.hide();
return true;
Expand Down
10 changes: 8 additions & 2 deletions js/ui/windowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ var WindowManager = class WindowManager {
this._cinnamonwm.connect('filter-keybinding', this._filterKeybinding.bind(this));
global.window_manager.connect('switch-workspace', (c, f, t, d) => this._switchWorkspace(c, f, t, d));

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

Expand Down Expand Up @@ -1390,11 +1392,11 @@ var WindowManager = class WindowManager {

_showWorkspaceSwitcher(display, window, binding) {
let bindingName = binding.get_name();
if (bindingName === 'switch-to-workspace-up') {
if (bindingName === 'toggle-workspace-selection') {
Main.expo.toggle();
return;
}
if (bindingName === 'switch-to-workspace-down') {
if (bindingName === 'toggle-window-selection') {
Main.overview.toggle();
return;
}
Expand All @@ -1406,6 +1408,10 @@ var WindowManager = class WindowManager {
this.actionMoveWorkspaceLeft();
} else if (bindingName === 'switch-to-workspace-right') {
this.actionMoveWorkspaceRight();
} else if (bindingName === 'switch-to-workspace-up') {
this.actionMoveWorkspaceUp();
} else if (bindingName === 'switch-to-workspace-down') {
this.actionMoveWorkspaceDown();
}
}

Expand Down
Loading