summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-01-23 01:05:22 +0100
committerDaniel Stone <daniels@collabora.com>2018-02-09 15:16:07 +0000
commitc34a9f5ca6611bfc64ded66ed464981285c78eeb (patch)
treecefc2c2c03a5197f0011d05da409adc5fa4d37d6
parent72032accbf6edf5a1f445f5d3ba67458e29f503e (diff)
downloadweston-c34a9f5ca6611bfc64ded66ed464981285c78eeb.tar.gz
screenshot: save screenshot files in XDG_PICTURES_DIR
If XDG_PICTURES_DIR not given, it will use the current directory, as it was before. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--clients/screenshot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/clients/screenshot.c b/clients/screenshot.c
index be8d9fe6..78a5d424 100644
--- a/clients/screenshot.c
+++ b/clients/screenshot.c
@@ -217,7 +217,8 @@ write_png(int width, int height)
CAIRO_FORMAT_ARGB32,
width, height, buffer_stride);
- fp = file_create_dated("wayland-screenshot-", ".png", filepath, sizeof(filepath));
+ fp = file_create_dated(getenv("XDG_PICTURES_DIR"), "wayland-screenshot-",
+ ".png", filepath, sizeof(filepath));
if (fp) {
fclose (fp);
cairo_surface_write_to_png(surface, filepath);