diff options
author | Dennis Real <github@tildepipe.org> | 2012-11-11 21:26:42 +0100 |
---|---|---|
committer | Dennis Real <github@tildepipe.org> | 2012-11-11 21:26:42 +0100 |
commit | a3d28a957f8b4a24cbc102a8dca77bb78b568ab4 (patch) | |
tree | 4025736270638f5035e28541b7edee40ef6700bb /src/wallpaper.c | |
parent | 0f6d9518b5a12538e4064ef1c397b62e6be61f3b (diff) | |
parent | 96d57781be7171d29c7ea0ecbbddc48ad374885c (diff) |
Merge branch 'master' of git://github.com/derf/feh
Diffstat (limited to 'src/wallpaper.c')
-rw-r--r-- | src/wallpaper.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/wallpaper.c b/src/wallpaper.c index 8a4cafb..df78303 100644 --- a/src/wallpaper.c +++ b/src/wallpaper.c @@ -257,6 +257,8 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, char *home; char filbuf[4096]; char fehbg_xinerama[] = "--no-xinerama"; + char *bgfill = NULL; + bgfill = opt.image_bg == IMAGE_BG_WHITE ? "--image-bg white" : "--image-bg black" ; /* local display to set closedownmode on */ Display *disp2; @@ -326,7 +328,10 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, D(("centering\n")); pmap_d1 = XCreatePixmap(disp, root, scr->width, scr->height, depth); - gcval.foreground = BlackPixel(disp, DefaultScreen(disp)); + if (opt.image_bg == IMAGE_BG_WHITE) + gcval.foreground = WhitePixel(disp, DefaultScreen(disp)); + else + gcval.foreground = BlackPixel(disp, DefaultScreen(disp)); gc = XCreateGC(disp, root, GCForeground, &gcval); XFillRectangle(disp, pmap_d1, gc, 0, 0, scr->width, scr->height); @@ -343,7 +348,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, XFreeGC(disp, gc); - fehbg = estrjoin(" ", "feh", fehbg_xinerama, "--bg-center", filbuf, NULL); + fehbg = estrjoin(" ", "feh", fehbg_xinerama, bgfill, "--bg-center", filbuf, NULL); } else if (filled == 1) { @@ -366,6 +371,10 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, XGCValues gcval; pmap_d1 = XCreatePixmap(disp, root, scr->width, scr->height, depth); + if (opt.image_bg == IMAGE_BG_WHITE) + gcval.foreground = WhitePixel(disp, DefaultScreen(disp)); + else + gcval.foreground = BlackPixel(disp, DefaultScreen(disp)); gcval.foreground = BlackPixel(disp, DefaultScreen(disp)); gc = XCreateGC(disp, root, GCForeground, &gcval); XFillRectangle(disp, pmap_d1, gc, 0, 0, scr->width, scr->height); @@ -383,7 +392,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled, XFreeGC(disp, gc); - fehbg = estrjoin(" ", "feh", fehbg_xinerama, "--bg-max", filbuf, NULL); + fehbg = estrjoin(" ", "feh", fehbg_xinerama, bgfill, "--bg-max", filbuf, NULL); } else { if (use_filelist) |