diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-21 17:00:12 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-10-21 17:00:12 +0200 |
commit | bf13408df23bb1fe92d6aaf81ff45044d3e1d1f7 (patch) | |
tree | 636bcc854a3bb1a82655b5fe17cfc5820edb9dc6 /sys/src/cmd/rio/scrl.c | |
parent | 5374d09d35ee47ae73bc17fa363c270c2c141315 (diff) |
rio: various fixes
use notefd in killprocs() insead of postnote() as the process
might'v exited. the notefd stays valid even if the particular
process it was originaly opend on exited. remove the Window.pid
field as its not needed.
dup() the notefd for interruptproc as the window might'v gone
away and closed the notefd file descriptor, resulting in us
writing to the wrong thing.
use snprint() instead of sprint() for safety.
fix bogus debug fprint().
add missing "visible" flushimage() after Reshaped winctl message
got handled. i assumed wsetname()/nameimage() would be enough,
it but does a invisible flush so softscreen doesnt get updated
immidiately.
do not make allocimage() failure in scrtemps() fatal. it wont
draw the window properly, but it gives the user a chance to
delete some windows to recover.
Diffstat (limited to 'sys/src/cmd/rio/scrl.c')
-rw-r--r-- | sys/src/cmd/rio/scrl.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/src/cmd/rio/scrl.c b/sys/src/cmd/rio/scrl.c index 4edbd66e4..1bd64899e 100644 --- a/sys/src/cmd/rio/scrl.c +++ b/sys/src/cmd/rio/scrl.c @@ -13,24 +13,25 @@ static Image *scrtmp; static -void +Image* scrtemps(void) { int h; - if(scrtmp) - return; - h = BIG*Dy(screen->r); - scrtmp = allocimage(display, Rect(0, 0, 32, h), screen->chan, 0, DNofill); - if(scrtmp == nil) - error("scrtemps"); + if(scrtmp == nil){ + h = BIG*Dy(screen->r); + scrtmp = allocimage(display, Rect(0, 0, 32, h), screen->chan, 0, DNofill); + } + return scrtmp; } void freescrtemps(void) { - freeimage(scrtmp); - scrtmp = nil; + if(scrtmp){ + freeimage(scrtmp); + scrtmp = nil; + } } static @@ -68,11 +69,10 @@ wscrdraw(Window *w) Rectangle r, r1, r2; Image *b; - scrtemps(); - if(w->i == nil) + b = scrtemps(); + if(b == nil || w->i == nil) return; r = w->scrollr; - b = scrtmp; r1 = r; r1.min.x = 0; r1.max.x = Dx(r); |