From 414592acf910573beaee6c7709b3052d398f1743 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 3 Feb 2022 22:40:23 +0300 Subject: [PATCH] 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: --- js/ui/screenshot.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index ad81c5512..2b70d1d0c 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -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 ); }