summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--man/feh.pre4
-rw-r--r--src/feh.h2
-rw-r--r--src/winwidget.c14
4 files changed, 17 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 740b4d0..461e934 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@ git HEAD
scroll offset in pixels
* feh(1): Escape %V (interpreted as mdoc macro)
(closes debian #745467)
+ * Respect --image-bg=checks in fullscreen mode (default remains black)
+ (closes #156)
Fri, 28 Feb 2014 18:20:25 +0100 Daniel Friesel <derf+feh@finalrewind.org>
diff --git a/man/feh.pre b/man/feh.pre
index 6e33769..bc446c2 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -327,7 +327,9 @@ Hide the pointer
.It Cm -B , --image-bg Ar style
.
Use style as background for transparent image parts and the like.
-Accepted values: checks (default), white, black.
+Accepted values: checks, white, black.
+.
+The default for windowed mode is checks, while fullscreen defaults to black.
.
.It Cm -i , --index
.
diff --git a/src/feh.h b/src/feh.h
index cd730e9..2864cad 100644
--- a/src/feh.h
+++ b/src/feh.h
@@ -102,7 +102,7 @@ enum slide_change { SLIDE_NEXT, SLIDE_PREV, SLIDE_RAND, SLIDE_FIRST, SLIDE_LAST,
SLIDE_JUMP_BACK
};
-enum image_bg { IMAGE_BG_CHECKS = 0, IMAGE_BG_BLACK, IMAGE_BG_WHITE };
+enum image_bg { IMAGE_BG_CHECKS = 1, IMAGE_BG_BLACK, IMAGE_BG_WHITE };
#define INPLACE_EDIT_FLIP -1
#define INPLACE_EDIT_MIRROR -2
diff --git a/src/winwidget.c b/src/winwidget.c
index 133aa89..01bb454 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -351,11 +351,19 @@ void winwidget_setup_pixmaps(winwidget winwid)
if (winwid->gc == None) {
XGCValues gcval;
- if (opt.image_bg == IMAGE_BG_WHITE)
+ if (opt.image_bg == IMAGE_BG_WHITE) {
gcval.foreground = WhitePixel(disp, DefaultScreen(disp));
- else
+ winwid->gc = XCreateGC(disp, winwid->win, GCForeground, &gcval);
+ }
+ else if (opt.image_bg == IMAGE_BG_CHECKS) {
+ gcval.tile = feh_create_checks();
+ gcval.fill_style = FillTiled;
+ winwid->gc = XCreateGC(disp, winwid->win, GCTile | GCFillStyle, &gcval);
+ }
+ else {
gcval.foreground = BlackPixel(disp, DefaultScreen(disp));
- winwid->gc = XCreateGC(disp, winwid->win, GCForeground, &gcval);
+ winwid->gc = XCreateGC(disp, winwid->win, GCForeground, &gcval);
+ }
}
winwid->bg_pmap = XCreatePixmap(disp, winwid->win, scr->width, scr->height, depth);
}