diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2018-02-06 15:18:38 -0600 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2018-02-07 11:39:36 +0200 |
commit | e277276b850bad39ed6995be5a82f24aa6b17bf1 (patch) | |
tree | d6e6b382f23ddb924eb745c75e44d4170b766ceb /clients/desktop-shell.c | |
parent | b7e3db6a76ca74c878a79717300d0a1f9b3be06e (diff) | |
download | weston-e277276b850bad39ed6995be5a82f24aa6b17bf1.tar.gz |
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>
Diffstat (limited to 'clients/desktop-shell.c')
-rw-r--r-- | clients/desktop-shell.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index 599295ee..12bc971e 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -49,6 +49,7 @@ #include "shared/helpers.h" #include "shared/xalloc.h" #include "shared/zalloc.h" +#include "shared/file-util.h" #include "weston-desktop-shell-client-protocol.h" @@ -760,8 +761,12 @@ background_draw(struct widget *widget, void *data) image = NULL; if (background->image) image = load_cairo_surface(background->image); - else if (background->color == 0) - image = load_cairo_surface(DATADIR "/weston/pattern.png"); + else if (background->color == 0) { + char *name = file_name_with_datadir("pattern.png"); + + image = load_cairo_surface(name); + free(name); + } if (image && background->type != -1) { im_w = cairo_image_surface_get_width(image); @@ -1351,10 +1356,13 @@ panel_add_launchers(struct panel *panel, struct desktop *desktop) } if (count == 0) { + char *name = file_name_with_datadir("terminal.png"); + /* add default launcher */ panel_add_launcher(panel, - DATADIR "/weston/terminal.png", + name, BINDIR "/weston-terminal"); + free(name); } } |