diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-21 22:54:37 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-21 22:54:37 -0700 |
commit | 4c3661fd7bd6a9970a9cc6b7f9573b8617401bd8 (patch) | |
tree | 3784f28199040dfbbc636729ff65682a4c8dab5e /clients/desktop-shell.c | |
parent | 1679f232e541489eedd94774bcfaec9752fdea64 (diff) | |
download | weston-4c3661fd7bd6a9970a9cc6b7f9573b8617401bd8.tar.gz |
desktop-shell: Only use default background if no background color is set
Previously we would only use the set background color if the
background-image value was explicitly set to empty or a non-existing
image. With this change, we only load the default background image
if there's no configure background image or background color. In case
of both an image and a color, the image takes precedence as before.
Diffstat (limited to 'clients/desktop-shell.c')
-rw-r--r-- | clients/desktop-shell.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index a0c6b6d4..4880888a 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -709,6 +709,8 @@ 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"); if (image && background->type != -1) { im_w = cairo_image_surface_get_width(image); @@ -1057,10 +1059,9 @@ background_create(struct desktop *desktop) s = weston_config_get_section(desktop->config, "shell", NULL, NULL); weston_config_section_get_string(s, "background-image", - &background->image, - DATADIR "/weston/pattern.png"); + &background->image, NULL); weston_config_section_get_uint(s, "background-color", - &background->color, 0xff002244); + &background->color, 0); weston_config_section_get_string(s, "background-type", &type, "tile"); |