ref: e3b96ea3476cdc2f544847537a9052a31d961ede
parent: 6543539a006eb655189d43bdcea467c9c9c2f37c
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri Feb 14 20:15:16 EST 2020
plan9: less flickering
--- a/plan9.c
+++ b/plan9.c
@@ -304,17 +304,30 @@
static void
redraw(void)
{
+ Rectangle r;
Point p, top, bot;
int x, y, len, rx, ry, i;
int oldbg, oldfg, bg, fg, attr, selected;
Rune c;
- draw(screen, screen->r, color[Dback], nil, ZP);
p = addpt(screen->r.min, Pt(Txtoff, Txtoff));
top = p;
bot.x = top.x;
bot.y = screen->r.max.y - Txtoff - charh*2;
+ r = screen->r;
+ r.max.y = r.min.y + Txtoff;
+ draw(screen, r, color[Dback], nil, ZP);
+ r = screen->r;
+ r.max.x = r.min.x + Txtoff;
+ draw(screen, r, color[Dback], nil, ZP);
+ r = screen->r;
+ r.min.x += MIN(field.width*charw, Dx(r)-Txtoff) + Txtoff;
+ draw(screen, r, color[Dback], nil, ZP);
+ r = screen->r;
+ r.min.y = MIN(top.y + field.height*charh, bot.y-charh);
+ draw(screen, r, color[Dback], nil, ZP);
+
bg = -1;
fg = -1;
for (y = 0; y < field.height && p.y < bot.y-charh; y++) {
@@ -751,7 +764,6 @@
case Cresize:
getwindow(display, Refnone);
- linebuf = realloc(linebuf, sizeof(Rune)*Dx(screen->r)/charw);
break;
case Ckey: