Screenshot: Move filesystem I/O to a thread
Writting the screenshot to a file can take a relativly long time in which we block the compositor, so do that part in a separate thread to avoid the hang. https://bugzilla.gnome.org/show_bug.cgi?id=652952
This commit is contained in:
@ -141,8 +141,13 @@ const GnomeShell = new Lang.Class({
|
||||
* indicating whether the operation was successful or not.
|
||||
*
|
||||
*/
|
||||
ScreenshotWindow : function (include_frame, filename) {
|
||||
return global.screenshot_window (include_frame, filename);
|
||||
ScreenshotWindowAsync : function (params, invocation) {
|
||||
let [include_frame, filename] = params;
|
||||
global.screenshot_window (include_frame, filename,
|
||||
function (obj, result) {
|
||||
let retval = GLib.Variant.new('(b)', [result]);
|
||||
invocation.return_value(retval);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user