screenshot: Discard invalid sized areas
https://bugzilla.gnome.org/show_bug.cgi?id=694998
This commit is contained in:
parent
bdfe459d64
commit
a3f625fe39
@ -76,6 +76,11 @@ const ScreenshotService = new Lang.Class({
|
|||||||
|
|
||||||
ScreenshotAreaAsync : function (params, invocation) {
|
ScreenshotAreaAsync : function (params, invocation) {
|
||||||
let [x, y, width, height, flash, filename, callback] = params;
|
let [x, y, width, height, flash, filename, callback] = params;
|
||||||
|
if (height <= 0 || width <= 0) {
|
||||||
|
invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
|
||||||
|
"Invalid params");
|
||||||
|
return;
|
||||||
|
}
|
||||||
let screenshot = new Shell.Screenshot();
|
let screenshot = new Shell.Screenshot();
|
||||||
screenshot.screenshot_area (x, y, width, height, filename,
|
screenshot.screenshot_area (x, y, width, height, filename,
|
||||||
Lang.bind(this, this._onScreenshotComplete,
|
Lang.bind(this, this._onScreenshotComplete,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user