aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2012-09-03 21:52:34 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2012-09-03 21:52:34 +0200
commit930b2c4a7f222e15e6493d5bbb8fd90e681d2626 (patch)
tree0a547de39cf0948af6c9bbf5b01289adf7724fbc
parenta984ffc4cb755c6dcdbc153b2591dca0ae6a8ead (diff)
downloadst-930b2c4a7f222e15e6493d5bbb8fd90e681d2626.tar.gz
st-930b2c4a7f222e15e6493d5bbb8fd90e681d2626.zip
Force redisplay of all lines in DECSCNM
When it is called DECSCNM all lines become dirty, because it is necessary redraw all lines for getting the new colors. It is easy see the problem running 'echo ^[[?5h'. In order to get a correct flash when running tput flash is necessary wait after DECSCNM, until the changes are displayed, because in other case the switch between reverse on/reverse off will be too much fast and nothing will happen. --- st.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
-rw-r--r--st.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/st.c b/st.c
index fde0493..193db5e 100644
--- a/st.c
+++ b/st.c
@@ -54,6 +54,7 @@
54 54
55#define SELECT_TIMEOUT (20*1000) /* 20 ms */ 55#define SELECT_TIMEOUT (20*1000) /* 20 ms */
56#define DRAW_TIMEOUT (20*1000) /* 20 ms */ 56#define DRAW_TIMEOUT (20*1000) /* 20 ms */
57#define REDRAW_TIMEOUT (80*1000) /* 80 ms */
57 58
58#define SERRNO strerror(errno) 59#define SERRNO strerror(errno)
59#define MIN(a, b) ((a) < (b) ? (a) : (b)) 60#define MIN(a, b) ((a) < (b) ? (a) : (b))
@@ -238,6 +239,7 @@ typedef struct {
238 239
239static void die(const char*, ...); 240static void die(const char*, ...);
240static void draw(void); 241static void draw(void);
242static void redraw(void);
241static void drawregion(int, int, int, int); 243static void drawregion(int, int, int, int);
242static void execsh(void); 244static void execsh(void);
243static void sigchld(int); 245static void sigchld(int);
@@ -1206,7 +1208,7 @@ tsetmode(bool priv, bool set, int *args, int narg) {
1206 mode = term.mode; 1208 mode = term.mode;
1207 MODBIT(term.mode,set, MODE_REVERSE); 1209 MODBIT(term.mode,set, MODE_REVERSE);
1208 if (mode != term.mode) 1210 if (mode != term.mode)
1209 draw(); 1211 redraw();
1210 break; 1212 break;
1211 case 7: 1213 case 7:
1212 MODBIT(term.mode, set, MODE_WRAP); 1214 MODBIT(term.mode, set, MODE_WRAP);
@@ -2030,6 +2032,14 @@ xdrawcursor(void) {
2030} 2032}
2031 2033
2032void 2034void
2035redraw(void) {
2036 struct timespec tv = {0, REDRAW_TIMEOUT * 1000};
2037 tfulldirt();
2038 draw();
2039 nanosleep(&tv, NULL);
2040}
2041
2042void
2033draw() { 2043draw() {
2034 drawregion(0, 0, term.col, term.row); 2044 drawregion(0, 0, term.col, term.row);
2035 xcopy(); 2045 xcopy();