screenshot: Allow bypassing lockdown setting

The setting is only relevant when writing to disk is required. We
will soon expose a screenshot method that doesn't, so make it
possible to ignore it.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/286
This commit is contained in:
Florian Müllner 2018-07-19 19:23:46 +02:00 committed by Florian Müllner
parent be84a00022
commit d2c75801ea

View File

@ -72,10 +72,13 @@ var ScreenshotService = new Lang.Class({
Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null);
},
_createScreenshot(invocation) {
_createScreenshot(invocation, needsDisk=true) {
let lockedDown = false;
if (needsDisk)
lockedDown = this._lockdownSettings.get_boolean('disable-save-to-disk')
let sender = invocation.get_sender();
if (this._screenShooter.has(sender) ||
this._lockdownSettings.get_boolean('disable-save-to-disk')) {
if (this._screenShooter.has(sender) || lockedDown) {
invocation.return_value(GLib.Variant.new('(bs)', [false, '']));
return null;
}