From 0c9a68aa8b78c7208aac9262f61522deb5e998e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 17 May 2021 10:50:41 +0200 Subject: [PATCH] Screenshot: Refactor ScreenshotManager.save_image In previous versions of GNOME Settings daemon (elementary OS <= 5), saving to clipboard was handled by the daemon. The daemon used to request Gala to save the screenshot in a temp path like "/tmp/gnome-settings-daemon-screenshot-XXXX" and copied the image to the clipboard from there. More information: https://github.com/elementary/gala/issues/474 Now, Gala is in charge of copying to clipboard when the take screenshot methods receive an empty filename. This commit: Move the code from save_image to save_image_to_file. --- src/ScreenshotManager.vala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ScreenshotManager.vala b/src/ScreenshotManager.vala index d12c1292..36f3813e 100644 --- a/src/ScreenshotManager.vala +++ b/src/ScreenshotManager.vala @@ -254,6 +254,10 @@ namespace Gala { } static async bool save_image (Cairo.ImageSurface image, string filename, out string used_filename) { + return yield save_image_to_file (image, filename, out used_filename); + } + + static async bool save_image_to_file (Cairo.ImageSurface image, string filename, out string used_filename) { used_filename = filename; // We only alter non absolute filename because absolute