screenshot-ui: Extract binding modes

We will re-use the same modes for more bindings in subsequent commits.
Also, while we're at it, invert the modes, to emphasize where the
screenshot UI cannot be used, rather than where it can be used.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2107>
This commit is contained in:
Ivan Molodetskikh 2022-02-03 22:40:23 +03:00 committed by Marge Bot
parent 5a18f00fa6
commit 414592acf9

View File

@ -1275,15 +1275,17 @@ var ScreenshotUI = GObject.registerClass({
this._rebuildMonitorBins();
});
const uiModes =
Shell.ActionMode.ALL &
~(Shell.ActionMode.LOCK_SCREEN |
Shell.ActionMode.UNLOCK_SCREEN |
Shell.ActionMode.LOGIN_SCREEN);
Main.wm.addKeybinding(
'show-screenshot-ui',
new Gio.Settings({ schema_id: 'org.gnome.shell.keybindings' }),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL |
Shell.ActionMode.OVERVIEW |
Shell.ActionMode.SYSTEM_MODAL |
Shell.ActionMode.LOOKING_GLASS |
Shell.ActionMode.POPUP,
uiModes,
showScreenshotUI
);
}