[hackers] [st] redraw if we scroll on resize || Devin J. Pohly

From: <hg_AT_suckless.org>
Date: Sun, 31 Oct 2010 18:28:15 +0000 (UTC)

changeset: 161:8bf9a341725e
user: Devin J. Pohly <djpohly_AT_djpohly.com>
date: Mon Oct 25 16:45:13 2010 -0400
files: st.c
description:
redraw if we scroll on resize

diff -r 1216e194d09f -r 8bf9a341725e st.c
--- a/st.c Mon Oct 25 16:00:10 2010 -0400
+++ b/st.c Mon Oct 25 16:45:13 2010 -0400
@@ -170,7 +170,7 @@
 static void tputc(char);
 static void tputs(char*, int);
 static void treset(void);
-static void tresize(int, int);
+static int tresize(int, int);
 static void tscrollup(int, int);
 static void tscrolldown(int, int);
 static void tsetattr(int*, int);
@@ -1202,7 +1202,7 @@
                 tputc(*s++);
 }
 
-void
+int
 tresize(int col, int row) {
         int i, x;
         int minrow = MIN(row, term.row);
@@ -1210,7 +1210,7 @@
         int slide = term.c.y - row + 1;
 
         if(col < 1 || row < 1)
- return;
+ return 0;
 
         /* free unneeded rows */
         i = 0;
@@ -1256,6 +1256,7 @@
         tmoveto(term.c.x, term.c.y);
         /* reset scrolling region */
         tsetscroll(0, row-1);
+ return (slide > 0);
 }
 
 void
@@ -1650,7 +1651,8 @@
         row = (xw.h - 2*BORDER) / xw.ch;
         if(col == term.col && row == term.row)
                 return;
- tresize(col, row);
+ if(tresize(col, row))
+ draw(SCREEN_REDRAW);
         ttyresize(col, row);
         xresize(col, row);
 }
Received on Sun Oct 31 2010 - 19:28:15 CET

This archive was generated by hypermail 2.2.0 : Sun Oct 31 2010 - 19:36:06 CET