Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use user-space variables to pass temporary screenshot data #482

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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