summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-02-05 18:04:23 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-02-05 18:04:23 +0100
commitc21d03b1730825b6d24e93edbdf6a2a187ecd2f9 (patch)
treee57378eed004af5dd122fd697558a0f6913a3b3d /src
parentf50062b40bbe0cba72eec0f84dd4fbdbece3baed (diff)
downloadfeh-c21d03b1730825b6d24e93edbdf6a2a187ecd2f9.zip
Apply 02_changeset_r51_bg_name_with_spaces.patch from Debian
Diffstat (limited to 'src')
-rw-r--r--src/support.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/support.c b/src/support.c
index 91dbe23..0377e14 100644
--- a/src/support.c
+++ b/src/support.c
@@ -162,6 +162,7 @@ feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
/* string for sticking in ~/.fehbg */
char *fehbg = NULL;
char *home;
+ char filbuf[4096];
/* local display to set closedownmode on */
Display *disp2;
@@ -173,6 +174,7 @@ feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
D(3, ("Falling back to XSetRootWindowPixmap\n"));
+ snprintf(filbuf, sizeof(filbuf), "\"%s\"", fil);
if (scaled) {
w = scr->width;
h = scr->height;
@@ -189,7 +191,7 @@ feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
pmap_d1 = XCreatePixmap(disp, root, w, h, depth);
gib_imlib_render_image_on_drawable_at_size(pmap_d1, im, 0, 0, w, h,
1, 0, 1);
- fehbg = estrjoin(" ", "feh --bg-scale", fil, NULL);
+ fehbg = estrjoin(" ", "feh --bg-scale", filbuf, NULL);
} else if (centered) {
XGCValues gcval;
GC gc;
@@ -216,14 +218,14 @@ feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
y = (h - gib_imlib_image_get_height(im)) >> 1;
gib_imlib_render_image_on_drawable(pmap_d1, im, x, y, 1, 0, 0);
XFreeGC(disp, gc);
- fehbg = estrjoin(" ", "feh --bg-center", fil, NULL);
+ fehbg = estrjoin(" ", "feh --bg-center", filbuf, NULL);
} else {
w = gib_imlib_image_get_width(im);
h = gib_imlib_image_get_height(im);
pmap_d1 =
XCreatePixmap(disp, root, w, h, depth);
gib_imlib_render_image_on_drawable(pmap_d1, im, 0, 0, 1, 0, 0);
- fehbg = estrjoin(" ", "feh --bg-tile", fil, NULL);
+ fehbg = estrjoin(" ", "feh --bg-tile", filbuf, NULL);
}
if (fehbg) {