diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index a6b2f5a1f..1dadb13c2 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -230,6 +230,10 @@
["<Super>9"]
Switch to application 9
+
+ ["Print"]
+ Show screenshot UI
+
{
+ // Nope, not dealing with monitor changes.
+ this.close(true);
+ });
+
+ 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,
+ showScreenshotUI
+ );
+ }
+
+ open() {
+ // Get rid of any popup menus.
+ // We already have them captured on the screenshot anyway.
+ //
+ // This needs to happen before the grab below as closing menus will
+ // pop their grabs.
+ Main.layoutManager.emit('system-modal-opened');
+
+ const grabResult = this._grabHelper.grab({
+ actor: this,
+ onUngrab: () => this.close(),
+ });
+ if (!grabResult)
+ return;
+
+ this.remove_all_transitions();
+ this.visible = true;
+ this.ease({
+ opacity: 255,
+ duration: 200,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+ }
+
+ _finishClosing() {
+ this.hide();
+ }
+
+ close(instantly = false) {
+ this._grabHelper.ungrab();
+
+ if (instantly) {
+ this._finishClosing();
+ return;
+ }
+
+ this.remove_all_transitions();
+ this.ease({
+ opacity: 0,
+ duration: 200,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ onComplete: this._finishClosing.bind(this),
+ });
+ }
+});
+
+/**
+ * Shows the screenshot UI.
+ */
+function showScreenshotUI() {
+ Main.screenshotUI.open();
+}
+
var ScreenshotService = class {
constructor() {
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(ScreenshotIface, this);