diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-11-29 17:51:57 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-11-29 17:51:57 +0100 |
commit | c931e96364ec6e587f9137e768ad0f9b70e2e9fa (patch) | |
tree | 4c3e76f35ec4ced4e40d6751ade59286c712c699 | |
parent | 1d93a5628adc0f08463fe4272dc88fb0f61e631d (diff) | |
download | plan9front-c931e96364ec6e587f9137e768ad0f9b70e2e9fa.tar.xz |
rio: avoid redrawing window text on resize for programs using libdraw
As long as the client as the mouse file open
and maintains reading the winname file of the window
after a resize we will avoid drawing the text frame
on a resize as it will be overdrawn by the client.
This reduces flicker on resize somewhat for slow systems.
-rw-r--r-- | sys/src/cmd/rio/dat.h | 1 | ||||
-rw-r--r-- | sys/src/cmd/rio/wind.c | 17 | ||||
-rw-r--r-- | sys/src/cmd/rio/xfid.c | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/sys/src/cmd/rio/dat.h b/sys/src/cmd/rio/dat.h index 1f3768450..edc855595 100644 --- a/sys/src/cmd/rio/dat.h +++ b/sys/src/cmd/rio/dat.h @@ -169,6 +169,7 @@ struct Window uchar deleted; uchar mouseopen; uchar kbdopen; + uchar winnameread; char *label; char *dir; }; diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index 808183817..b2391cabb 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -101,16 +101,19 @@ wresize(Window *w, Image *i) frinit(w, r, w->font, w->i, cols); wsetcols(w, 1); w->maxtab = maxtab*stringwidth(w->font, "0"); - r = insetrect(w->i->r, Selborder); - draw(w->i, r, cols[BACK], nil, w->entire.min); - wfill(w); - wsetselect(w, w->q0, w->q1); - wscrdraw(w); + if(!w->mouseopen || !w->winnameread){ + r = insetrect(w->i->r, Selborder); + draw(w->i, r, cols[BACK], nil, w->entire.min); + wfill(w); + wsetselect(w, w->q0, w->q1); + wscrdraw(w); + } wborder(w, Selborder); flushimage(display, 1); wsetname(w); w->topped = ++topped; w->resized = TRUE; + w->winnameread = FALSE; w->mouse.counter++; w->wctlready = 1; } @@ -751,7 +754,7 @@ void wrepaint(Window *w) { wsetcols(w, w == input); - if(!w->mouseopen) + if(!w->mouseopen || !w->winnameread) frredraw(w); if(w == input) wborder(w, Selborder); @@ -1180,7 +1183,7 @@ wctlmesg(Window *w, int m, Rectangle r, void *p) flushimage(display, 1); break; case Refresh: - if(w->i==nil || Dx(w->screenr)<=0 || w->mouseopen) + if(w->i==nil || Dx(w->screenr)<=0) break; wrefresh(w); flushimage(display, 1); diff --git a/sys/src/cmd/rio/xfid.c b/sys/src/cmd/rio/xfid.c index 3985bea00..27054f8ef 100644 --- a/sys/src/cmd/rio/xfid.c +++ b/sys/src/cmd/rio/xfid.c @@ -345,6 +345,7 @@ xfidclose(Xfid *x) case Qmouse: w->resized = FALSE; w->mouseopen = FALSE; + w->winnameread = FALSE; if(w->i != nil) wsendctlmesg(w, Refresh, w->i->r, nil); break; @@ -776,6 +777,7 @@ xfidread(Xfid *x) break; } t = estrdup(w->name); + w->winnameread = TRUE; goto Text; case Qwindow: |