mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
screenshot: Discard invalid sized areas
https://bugzilla.gnome.org/show_bug.cgi?id=694998
This commit is contained in:
parent
bdfe459d64
commit
a3f625fe39
1 changed files with 5 additions and 0 deletions
|
|
@ -76,6 +76,11 @@ const ScreenshotService = new Lang.Class({
|
|||
|
||||
ScreenshotAreaAsync : function (params, invocation) {
|
||||
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();
|
||||
screenshot.screenshot_area (x, y, width, height, filename,
|
||||
Lang.bind(this, this._onScreenshotComplete,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue