always redraw images

Previously when covering the sent window with an image slide selected and
exposing it again, the image was lost. This change always redraws the image and
also removes the now redundant bit flag in the state enum.
This commit is contained in:
Markus Teich 2016-09-26 12:26:11 +02:00
parent efea6575ca
commit dca314e7a9

7
sent.c
View File

@ -33,7 +33,6 @@ char *argv0;
typedef enum { typedef enum {
NONE = 0, NONE = 0,
SCALED = 1, SCALED = 1,
DRAWN = 2
} imgstate; } imgstate;
typedef struct { typedef struct {
@ -320,7 +319,6 @@ ffdraw(Image *img)
XPutImage(xw.dpy, xw.win, d->gc, img->ximg, 0, 0, XPutImage(xw.dpy, xw.win, d->gc, img->ximg, 0, 0,
xoffset, yoffset, img->ximg->width, img->ximg->height); xoffset, yoffset, img->ximg->width, img->ximg->height);
XFlush(xw.dpy); XFlush(xw.dpy);
img->state |= DRAWN;
} }
void void
@ -441,7 +439,7 @@ advance(const Arg *arg)
LIMIT(new_idx, 0, slidecount-1); LIMIT(new_idx, 0, slidecount-1);
if (new_idx != idx) { if (new_idx != idx) {
if (slides[idx].img) if (slides[idx].img)
slides[idx].img->state &= ~(DRAWN | SCALED); slides[idx].img->state &= ~SCALED;
idx = new_idx; idx = new_idx;
ffload(&slides[idx]); ffload(&slides[idx]);
xdraw(); xdraw();
@ -514,7 +512,6 @@ xdraw()
} else { } else {
if (!(im->state & SCALED)) if (!(im->state & SCALED))
ffprepare(im); ffprepare(im);
if (!(im->state & DRAWN))
ffdraw(im); ffdraw(im);
} }
} }
@ -645,7 +642,7 @@ configure(XEvent *e)
{ {
resize(e->xconfigure.width, e->xconfigure.height); resize(e->xconfigure.width, e->xconfigure.height);
if (slides[idx].img) if (slides[idx].img)
slides[idx].img->state &= ~(DRAWN | SCALED); slides[idx].img->state &= ~SCALED;
xdraw(); xdraw();
} }