From 2648724dc71c9461a8b43989ca31e8080197b95c Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Thu, 27 Jan 2005 04:14:45 +0000
Subject: [PATCH] Fix bug in exposure calculation, remove unneeded XFlush()
 calls, redraw screen on mode change and window re-size.

---
 src/conio/console.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/conio/console.c b/src/conio/console.c
index e4090cff36..abd22483be 100644
--- a/src/conio/console.c
+++ b/src/conio/console.c
@@ -449,7 +449,6 @@ video_update_text()
 					setgc(vmem[r * DpyCols + c]  & 0xff00);
 					x11.XCopyPlane(dpy,pfnt,win,gc,0,FH*(vmem[r * DpyCols + c]&0xff),FW,FH,c*FW+2,r*FH+2,1);
 					lines[r].changed = 2;
-					lines[r].exposed[c]=0;
 				}
 			}
 	    }
@@ -469,7 +468,6 @@ video_update_text()
 		}
 		lines[r].changed = 0;
 		memset(lines[r].exposed,0,CONSOLE_MAX_COLS * sizeof(u_char));
-		x11.XFlush(dpy);
 	}
 
 	if (CursStart <= CursEnd && CursEnd <= FH &&
@@ -594,7 +592,7 @@ void expose_chars(int x, int y, int width, int height)
 	sy/=FH;
 	ey/=FH;
 	if(ey>DpyRows)
-		ex=DpyRows;
+		ey=DpyRows;
 
 	for(r=sy;r<=ey;r++) {
 		for(c=sx;c<=ex;c++) {
@@ -1185,6 +1183,12 @@ resize_window()
 
     x11.XFree(sh);
 
+	if(lines != NULL) {
+		for (r = 0; r < (CONSOLE_MAX_ROWS+1); ++r) {
+			lines[r].changed = 1;
+		}
+	}
+
     return;
 }
 
-- 
GitLab