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>
dev
Aleksander Morgado 7 years ago committed by Daniel Stone
parent 72032accbf
commit c34a9f5ca6
  1. 3
      clients/screenshot.c

@ -217,7 +217,8 @@ write_png(int width, int height)
CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_ARGB32,
width, height, buffer_stride); 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) { if (fp) {
fclose (fp); fclose (fp);
cairo_surface_write_to_png(surface, filepath); cairo_surface_write_to_png(surface, filepath);

Loading…
Cancel
Save