summaryrefslogtreecommitdiff
path: root/sent.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-09-26 12:26:11 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-09-26 12:26:11 +0200
commitdca314e7a93633ef7415e0d21b82c63278ae8e7c (patch)
tree5afeace3fe53a3972e6154d6ad52c01a397e3246 /sent.c
parentefea6575ca7f27b2c415fe0866349a842699fb72 (diff)
downloadsent-dca314e7a93633ef7415e0d21b82c63278ae8e7c.tar.gz
sent-dca314e7a93633ef7415e0d21b82c63278ae8e7c.tar.bz2
sent-dca314e7a93633ef7415e0d21b82c63278ae8e7c.zip
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.
Diffstat (limited to 'sent.c')
-rw-r--r--sent.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sent.c b/sent.c
index fc319be..82acd81 100644
--- a/sent.c
+++ b/sent.c
@@ -33,7 +33,6 @@ char *argv0;
typedef enum {
NONE = 0,
SCALED = 1,
- DRAWN = 2
} imgstate;
typedef struct {
@@ -320,7 +319,6 @@ ffdraw(Image *img)
XPutImage(xw.dpy, xw.win, d->gc, img->ximg, 0, 0,
xoffset, yoffset, img->ximg->width, img->ximg->height);
XFlush(xw.dpy);
- img->state |= DRAWN;
}
void
@@ -441,7 +439,7 @@ advance(const Arg *arg)
LIMIT(new_idx, 0, slidecount-1);
if (new_idx != idx) {
if (slides[idx].img)
- slides[idx].img->state &= ~(DRAWN | SCALED);
+ slides[idx].img->state &= ~SCALED;
idx = new_idx;
ffload(&slides[idx]);
xdraw();
@@ -514,8 +512,7 @@ xdraw()
} else {
if (!(im->state & SCALED))
ffprepare(im);
- if (!(im->state & DRAWN))
- ffdraw(im);
+ ffdraw(im);
}
}
@@ -645,7 +642,7 @@ configure(XEvent *e)
{
resize(e->xconfigure.width, e->xconfigure.height);
if (slides[idx].img)
- slides[idx].img->state &= ~(DRAWN | SCALED);
+ slides[idx].img->state &= ~SCALED;
xdraw();
}
Software created with 💖