[hackers] [sent] always redraw images || Markus Teich

From: <git_AT_suckless.org>
Date: Mon, 26 Sep 2016 12:26:36 +0200 (CEST)

commit dca314e7a93633ef7415e0d21b82c63278ae8e7c
Author: Markus Teich <markus.teich_AT_stusta.mhn.de>
AuthorDate: Mon Sep 26 12:26:11 2016 +0200
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Mon Sep 26 12:26:11 2016 +0200

    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.

diff --git a/sent.c b/sent.c
index fc319be..82acd81 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -33,7 +33,6 @@ char *argv0;
 typedef enum {
         NONE = 0,
         SCALED = 1,
- DRAWN = 2
 } imgstate;
 
 typedef struct {
_AT_@ -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
_AT_@ -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();
_AT_@ -514,8 +512,7 @@ xdraw()
         } else {
                 if (!(im->state & SCALED))
                         ffprepare(im);
- if (!(im->state & DRAWN))
- ffdraw(im);
+ ffdraw(im);
         }
 }
 
_AT_@ -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();
 }
 
Received on Mon Sep 26 2016 - 12:26:36 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 26 2016 - 12:36:17 CEST