@ -63,8 +63,6 @@ char *argv0;
# define XK_NO_MOD 0
# define XK_NO_MOD 0
# define XK_SWITCH_MOD (1<<13)
# define XK_SWITCH_MOD (1<<13)
# define REDRAW_TIMEOUT (80*1000) /* 80 ms */
/* macros */
/* macros */
# define MIN(a, b) ((a) < (b) ? (a) : (b))
# define MIN(a, b) ((a) < (b) ? (a) : (b))
# define MAX(a, b) ((a) < (b) ? (b) : (a))
# define MAX(a, b) ((a) < (b) ? (b) : (a))
@ -349,7 +347,7 @@ typedef struct {
static void die ( const char * , . . . ) ;
static void die ( const char * , . . . ) ;
static void draw ( void ) ;
static void draw ( void ) ;
static void redraw ( int ) ;
static void redraw ( void ) ;
static void drawregion ( int , int , int , int ) ;
static void drawregion ( int , int , int , int ) ;
static void execsh ( void ) ;
static void execsh ( void ) ;
static void sigchld ( int ) ;
static void sigchld ( int ) ;
@ -1826,7 +1824,7 @@ tsetmode(bool priv, bool set, int *args, int narg) {
mode = term . mode ;
mode = term . mode ;
MODBIT ( term . mode , set , MODE_REVERSE ) ;
MODBIT ( term . mode , set , MODE_REVERSE ) ;
if ( mode ! = term . mode )
if ( mode ! = term . mode )
redraw ( REDRAW_TIMEOUT ) ;
redraw ( ) ;
break ;
break ;
case 6 : /* DECOM -- Origin */
case 6 : /* DECOM -- Origin */
MODBIT ( term . c . state , set , CURSOR_ORIGIN ) ;
MODBIT ( term . c . state , set , CURSOR_ORIGIN ) ;
@ -2200,7 +2198,7 @@ strhandle(void) {
* TODO if defaultbg color is changed , borders
* TODO if defaultbg color is changed , borders
* are dirty
* are dirty
*/
*/
redraw ( 0 ) ;
redraw ( ) ;
}
}
return ;
return ;
}
}
@ -3093,7 +3091,7 @@ xzoomabs(const Arg *arg) {
xunloadfonts ( ) ;
xunloadfonts ( ) ;
xloadfonts ( usedfont , arg - > i ) ;
xloadfonts ( usedfont , arg - > i ) ;
cresize ( 0 , 0 ) ;
cresize ( 0 , 0 ) ;
redraw ( 0 ) ;
redraw ( ) ;
xhints ( ) ;
xhints ( ) ;
}
}
@ -3558,16 +3556,9 @@ xresettitle(void) {
}
}
void
void
redraw ( int timeout ) {
struct timespec tv = { 0 , timeout * 1000 } ;
redraw ( void ) {
tfulldirt ( ) ;
tfulldirt ( ) ;
draw ( ) ;
draw ( ) ;
if ( timeout > 0 ) {
nanosleep ( & tv , NULL ) ;
XSync ( xw . dpy , False ) ; /* necessary for a good tput flash */
}
}
}
void
void
@ -3634,7 +3625,7 @@ expose(XEvent *ev) {
if ( ! e - > count )
if ( ! e - > count )
xw . state & = ~ WIN_REDRAW ;
xw . state & = ~ WIN_REDRAW ;
}
}
redraw ( 0 ) ;
redraw ( ) ;
}
}
void
void