Skip to content

Commit

Permalink
Use user-space variables to pass temporary screenshot data
Browse files Browse the repository at this point in the history
  • Loading branch information
fossfreedom committed Oct 18, 2023
1 parent bfee2a0 commit 9382a64
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/daemon/screenshot.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 9382a64

Please sign in to comment.