shared: Update all users of DATADIR

Replace every use of DATADIR to create a filename with a call to the new
function that allows overriding DATADIR with an env var at runtime.

No attention is paid to asprintf failure.

This restores make distcheck to a passing state after commit 6b58ea
began checking cairo surfaces for validity and exchanged undefined
behaviour we shouldn't have been dependent on for consistent test failure.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: split if-branches into two lines]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Derek Foreman
2018-02-06 15:18:38 -06:00
committed by Pekka Paalanen
parent b7e3db6a76
commit e277276b85
4 changed files with 68 additions and 15 deletions
+5 -1
View File
@@ -56,6 +56,7 @@
#include "shared/helpers.h"
#include "shared/image-loader.h"
#include "shared/timespec-util.h"
#include "shared/file-util.h"
#include "gl-renderer.h"
#include "weston-egl-ext.h"
#include "pixman-renderer.h"
@@ -911,6 +912,7 @@ x11_output_enable(struct weston_output *base)
xcb_screen_t *screen;
struct wm_normal_hints normal_hints;
struct wl_event_loop *loop;
char *icon_filename;
int ret;
uint32_t mask = XCB_CW_EVENT_MASK | XCB_CW_CURSOR;
@@ -991,7 +993,9 @@ x11_output_enable(struct weston_output *base)
b->atom.wm_class, b->atom.string, 8,
sizeof class, class);
x11_output_set_icon(b, output, DATADIR "/weston/wayland.png");
icon_filename = file_name_with_datadir("wayland.png");
x11_output_set_icon(b, output, icon_filename);
free(icon_filename);
x11_output_set_wm_protocols(b, output);