X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=e1139ecba4988787e28ae7d2d652532efa007cbe;hb=b8804f9f675b79ddd2db47aeef626d6ae3ce5ca3;hp=142a15211ef492e0e62e41047ee5c8e36075d575;hpb=7dd24bfb4c80960567d2d4dd4cf7ca5f2af95a52;p=st.git diff --git a/st.c b/st.c index 142a152..e1139ec 100644 --- a/st.c +++ b/st.c @@ -63,8 +63,6 @@ char *argv0; #define XK_NO_MOD 0 #define XK_SWITCH_MOD (1<<13) -#define REDRAW_TIMEOUT (80*1000) /* 80 ms */ - /* macros */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) < (b) ? (b) : (a)) @@ -349,7 +347,7 @@ typedef struct { static void die(const char *, ...); static void draw(void); -static void redraw(int); +static void redraw(void); static void drawregion(int, int, int, int); static void execsh(void); static void sigchld(int); @@ -1826,7 +1824,7 @@ tsetmode(bool priv, bool set, int *args, int narg) { mode = term.mode; MODBIT(term.mode, set, MODE_REVERSE); if(mode != term.mode) - redraw(REDRAW_TIMEOUT); + redraw(); break; case 6: /* DECOM -- Origin */ MODBIT(term.c.state, set, CURSOR_ORIGIN); @@ -2200,7 +2198,7 @@ strhandle(void) { * TODO if defaultbg color is changed, borders * are dirty */ - redraw(0); + redraw(); } return; } @@ -3093,7 +3091,7 @@ xzoomabs(const Arg *arg) { xunloadfonts(); xloadfonts(usedfont, arg->i); cresize(0, 0); - redraw(0); + redraw(); xhints(); } @@ -3558,16 +3556,9 @@ xresettitle(void) { } void -redraw(int timeout) { - struct timespec tv = {0, timeout * 1000}; - +redraw(void) { tfulldirt(); draw(); - - if(timeout > 0) { - nanosleep(&tv, NULL); - XSync(xw.dpy, False); /* necessary for a good tput flash */ - } } void @@ -3634,7 +3625,7 @@ expose(XEvent *ev) { if(!e->count) xw.state &= ~WIN_REDRAW; } - redraw(0); + redraw(); } void @@ -3938,7 +3929,7 @@ run(void) { void usage(void) { - die("%s " VERSION " (c) 2010-2014 st engineers\n" \ + die("%s " VERSION " (c) 2010-2015 st engineers\n" \ "usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]\n" " [-i] [-t title] [-w windowid] [-e command ...]\n", argv0); }