windowManager: Reindent shortcuts setup

We require all new code to use the non-legacy style. Updating code
on a case-by-case basis works fairly well most of the time, but
here we have a big uniform block, where any addition with a different
style would stick out badly.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5670

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2716>
This commit is contained in:
Florian Müllner 2023-03-21 18:09:08 +01:00
parent ce14b316ff
commit e9cabd00fb

View File

@ -614,246 +614,256 @@ var WindowManager = class {
this.allowKeybinding('switch-to-session-12', Shell.ActionMode.ALL); this.allowKeybinding('switch-to-session-12', Shell.ActionMode.ALL);
this.setCustomKeybindingHandler('switch-to-workspace-left', this.setCustomKeybindingHandler('switch-to-workspace-left',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-right', this.setCustomKeybindingHandler('switch-to-workspace-right',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-up', this.setCustomKeybindingHandler('switch-to-workspace-up',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-down', this.setCustomKeybindingHandler('switch-to-workspace-down',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-last', this.setCustomKeybindingHandler('switch-to-workspace-last',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-left', this.setCustomKeybindingHandler('move-to-workspace-left',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-right', this.setCustomKeybindingHandler('move-to-workspace-right',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-up', this.setCustomKeybindingHandler('move-to-workspace-up',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-down', this.setCustomKeybindingHandler('move-to-workspace-down',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-1', this.setCustomKeybindingHandler('switch-to-workspace-1',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-2', this.setCustomKeybindingHandler('switch-to-workspace-2',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-3', this.setCustomKeybindingHandler('switch-to-workspace-3',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-4', this.setCustomKeybindingHandler('switch-to-workspace-4',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-5', this.setCustomKeybindingHandler('switch-to-workspace-5',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-6', this.setCustomKeybindingHandler('switch-to-workspace-6',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-7', this.setCustomKeybindingHandler('switch-to-workspace-7',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-8', this.setCustomKeybindingHandler('switch-to-workspace-8',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-9', this.setCustomKeybindingHandler('switch-to-workspace-9',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-10', this.setCustomKeybindingHandler('switch-to-workspace-10',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-11', this.setCustomKeybindingHandler('switch-to-workspace-11',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-to-workspace-12', this.setCustomKeybindingHandler('switch-to-workspace-12',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-1', this.setCustomKeybindingHandler('move-to-workspace-1',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-2', this.setCustomKeybindingHandler('move-to-workspace-2',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-3', this.setCustomKeybindingHandler('move-to-workspace-3',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-4', this.setCustomKeybindingHandler('move-to-workspace-4',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-5', this.setCustomKeybindingHandler('move-to-workspace-5',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-6', this.setCustomKeybindingHandler('move-to-workspace-6',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-7', this.setCustomKeybindingHandler('move-to-workspace-7',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-8', this.setCustomKeybindingHandler('move-to-workspace-8',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-9', this.setCustomKeybindingHandler('move-to-workspace-9',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-10', this.setCustomKeybindingHandler('move-to-workspace-10',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-11', this.setCustomKeybindingHandler('move-to-workspace-11',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-12', this.setCustomKeybindingHandler('move-to-workspace-12',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('move-to-workspace-last', this.setCustomKeybindingHandler('move-to-workspace-last',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._showWorkspaceSwitcher.bind(this)); this._showWorkspaceSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-applications', this.setCustomKeybindingHandler('switch-applications',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-group', this.setCustomKeybindingHandler('switch-group',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-applications-backward', this.setCustomKeybindingHandler('switch-applications-backward',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-group-backward', this.setCustomKeybindingHandler('switch-group-backward',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-windows', this.setCustomKeybindingHandler('switch-windows',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-windows-backward', this.setCustomKeybindingHandler('switch-windows-backward',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-windows', this.setCustomKeybindingHandler('cycle-windows',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-windows-backward', this.setCustomKeybindingHandler('cycle-windows-backward',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-group', this.setCustomKeybindingHandler('cycle-group',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('cycle-group-backward', this.setCustomKeybindingHandler('cycle-group-backward',
Shell.ActionMode.NORMAL, Shell.ActionMode.NORMAL,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.setCustomKeybindingHandler('switch-panels', this.setCustomKeybindingHandler('switch-panels',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW |
Shell.ActionMode.OVERVIEW | Shell.ActionMode.LOCK_SCREEN | Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOCK_SCREEN |
Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOGIN_SCREEN, Shell.ActionMode.LOGIN_SCREEN,
this._startA11ySwitcher.bind(this)); this._startA11ySwitcher.bind(this));
this.setCustomKeybindingHandler('switch-panels-backward', this.setCustomKeybindingHandler('switch-panels-backward',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW |
Shell.ActionMode.OVERVIEW | Shell.ActionMode.LOCK_SCREEN | Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOCK_SCREEN |
Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOGIN_SCREEN, Shell.ActionMode.LOGIN_SCREEN,
this._startA11ySwitcher.bind(this)); this._startA11ySwitcher.bind(this));
this.setCustomKeybindingHandler('switch-monitor', this.setCustomKeybindingHandler('switch-monitor',
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._startSwitcher.bind(this)); this._startSwitcher.bind(this));
this.addKeybinding('toggle-message-tray', this.addKeybinding('toggle-message-tray',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW |
Shell.ActionMode.OVERVIEW |
Shell.ActionMode.POPUP, Shell.ActionMode.POPUP,
this._toggleCalendar.bind(this)); this._toggleCalendar.bind(this));
this.addKeybinding('switch-to-application-1', this.addKeybinding('switch-to-application-1',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-2', this.addKeybinding('switch-to-application-2',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-3', this.addKeybinding('switch-to-application-3',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-4', this.addKeybinding('switch-to-application-4',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-5', this.addKeybinding('switch-to-application-5',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-6', this.addKeybinding('switch-to-application-6',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-7', this.addKeybinding('switch-to-application-7',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-8', this.addKeybinding('switch-to-application-8',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
this.addKeybinding('switch-to-application-9', this.addKeybinding('switch-to-application-9',
new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}), new Gio.Settings({schema_id: SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
Shell.ActionMode.OVERVIEW,
this._switchToApplication.bind(this)); this._switchToApplication.bind(this));
global.stage.connect('scroll-event', (stage, event) => { global.stage.connect('scroll-event', (stage, event) => {