From 9382a647d41cc45505a889c28204262fc3d1766e Mon Sep 17 00:00:00 2001 From: David Mohammed Date: Wed, 18 Oct 2023 18:41:36 +0100 Subject: [PATCH] Use user-space variables to pass temporary screenshot data --- src/daemon/screenshot.vala | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/daemon/screenshot.vala b/src/daemon/screenshot.vala index 3ec06cf14..c79eee521 100644 --- a/src/daemon/screenshot.vala +++ b/src/daemon/screenshot.vala @@ -64,12 +64,10 @@ namespace BudgieScr { showtooltips = screenshot_settings.get_boolean("showtooltips"); }); - // we need to use the same temporary file across instances - // so use the logged in user to differentiate in multiuser - // scenarios - string username = Environment.get_user_name(); - string tmpdir = Environment.get_tmp_dir(); - tempfile_path = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, username + "_budgiescreenshot_tempfile"); + // we need to use the same temporary user-space file across dbus client/server calls to coordinate + // the passing of screenshot images + string tmpdir = Environment.get_variable("XDG_RUNTIME_DIR") ?? Environment.get_variable("HOME"); + tempfile_path = GLib.Path.build_path(GLib.Path.DIR_SEPARATOR_S, tmpdir, ".budgiescreenshot_tempfile"); } private void fill_buttonpos() {