screenshot: Remove shooter from sender in finally block
We do this in both the try{} and the catch{} block, so we might as well put it into a finally{} block. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1658>
This commit is contained in:
parent
c1bfdd74d8
commit
3510b88bdc
@ -200,10 +200,10 @@ var ScreenshotService = class {
|
|||||||
screenshot.screenshot_area(x, y, width, height, stream),
|
screenshot.screenshot_area(x, y, width, height, stream),
|
||||||
]);
|
]);
|
||||||
this._onScreenshotComplete(stream, file, invocation);
|
this._onScreenshotComplete(stream, file, invocation);
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
||||||
|
} finally {
|
||||||
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,10 +223,10 @@ var ScreenshotService = class {
|
|||||||
screenshot.screenshot_window(includeFrame, includeCursor, stream),
|
screenshot.screenshot_window(includeFrame, includeCursor, stream),
|
||||||
]);
|
]);
|
||||||
this._onScreenshotComplete(stream, file, invocation);
|
this._onScreenshotComplete(stream, file, invocation);
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
||||||
|
} finally {
|
||||||
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,10 +246,10 @@ var ScreenshotService = class {
|
|||||||
screenshot.screenshot(includeCursor, stream),
|
screenshot.screenshot(includeCursor, stream),
|
||||||
]);
|
]);
|
||||||
this._onScreenshotComplete(stream, file, invocation);
|
this._onScreenshotComplete(stream, file, invocation);
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this._removeShooterForSender(invocation.get_sender());
|
|
||||||
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
invocation.return_value(new GLib.Variant('(bs)', [false, '']));
|
||||||
|
} finally {
|
||||||
|
this._removeShooterForSender(invocation.get_sender());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user