diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-13 16:36:24 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-02-13 16:36:24 +0100 |
commit | c3867623ae93eca77ba6e4f3d851240442f02caf (patch) | |
tree | c699ffbb3c22a919785ee51ced41ff9344a42b21 /sys/src/cmd/rio/wind.c | |
parent | eeb96dca21dfc28afa69f3d00fa6f2cdb7e9b1b8 (diff) |
rio: fix wrong frame colors when moving non-current window
When a window is moved or reshaped, that implicitely tops
the window and makes it current. The conseqence of this
is that we always have to redraw the window as if it where
a current window in any case. This was handled for Reshaped
windows, but not when the window was just moved. We now
handle both cases the exact same way, getting rid of the
Moved wctl message.
Diffstat (limited to 'sys/src/cmd/rio/wind.c')
-rw-r--r-- | sys/src/cmd/rio/wind.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/sys/src/cmd/rio/wind.c b/sys/src/cmd/rio/wind.c index 9b1fff188..72a8286f5 100644 --- a/sys/src/cmd/rio/wind.c +++ b/sys/src/cmd/rio/wind.c @@ -87,13 +87,10 @@ wsetname(Window *w) } void -wresize(Window *w, Image *i, int move) +wresize(Window *w, Image *i) { - Rectangle r, or; + Rectangle r; - or = w->i->r; - if(move || (Dx(or)==Dx(i->r) && Dy(or)==Dy(i->r))) - draw(i, i->r, w->i, nil, w->i->r.min); freeimage(w->i); w->i = i; w->mc.image = i; @@ -102,19 +99,15 @@ wresize(Window *w, Image *i, int move) w->scrollr.max.x = r.min.x+Scrollwid; w->lastsr = ZR; r.min.x += Scrollwid+Scrollgap; - if(move) - frsetrects(w, r, w->i); - else{ - frclear(w, FALSE); - 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); - } + frclear(w, FALSE); + 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); wborder(w, Selborder); wsetname(w); w->topped = ++topped; @@ -124,9 +117,10 @@ wresize(Window *w, Image *i, int move) } void -wrefresh(Window *w, Rectangle r) +wrefresh(Window *w) { - /* BUG: rectangle is ignored */ + Rectangle r; + if(w == input) wborder(w, Selborder); else @@ -1127,7 +1121,6 @@ wctlmesg(Window *w, int m, Rectangle r, void *p) if(p!=nil) sendp((Channel*)p, w); break; - case Moved: case Reshaped: if(w->deleted){ freeimage(i); @@ -1135,7 +1128,7 @@ wctlmesg(Window *w, int m, Rectangle r, void *p) } w->screenr = r; strcpy(buf, w->name); - wresize(w, i, m==Moved); + wresize(w, i); proccreate(deletetimeoutproc, estrdup(buf), 4096); flushimage(display, 1); if(Dx(r)<=0){ /* window got hidden, if we had the input, drop it */ @@ -1189,9 +1182,9 @@ wctlmesg(Window *w, int m, Rectangle r, void *p) flushimage(display, 1); break; case Refresh: - if(w->i==nil || Dx(w->screenr)<=0 || !rectclip(&r, w->i->r) || w->mouseopen) + if(w->i==nil || Dx(w->screenr)<=0 || w->mouseopen) break; - wrefresh(w, r); + wrefresh(w); flushimage(display, 1); break; case Movemouse: |