diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-08-16 06:32:34 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-08-16 06:32:34 +0200 |
commit | 711557c85edf003b28019264804545aec2ce2a75 (patch) | |
tree | 77b5fb439dced9ed1926f7904866cf210857eb7c /sys/src/cmd/rio/rio.c | |
parent | 2eb369bb1d02d609b38184ed86deba9be8be73dc (diff) |
rio: add some tolerance when declaring windows covered
Diffstat (limited to 'sys/src/cmd/rio/rio.c')
-rw-r--r-- | sys/src/cmd/rio/rio.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c index ea4420859..f9c97d8d9 100644 --- a/sys/src/cmd/rio/rio.c +++ b/sys/src/cmd/rio/rio.c @@ -656,28 +656,29 @@ resized(void) } static int -wcovered(Window *w, Rectangle r) +wcovered(Window *w, Rectangle r, int i) { Window *t; - int i; - for(i=0; i<nwindow; i++){ + if(Dx(r) < font->height || Dy(r) < font->height) + return 1; + for(; i<nwindow; i++){ t = window[i]; if(t == w || t->topped <= w->topped || t->deleted) continue; if(Dx(t->screenr) == 0 || Dy(t->screenr) == 0 || rectXrect(r, t->screenr) == 0) continue; if(r.min.y < t->screenr.min.y) - if(!wcovered(w, Rect(r.min.x, r.min.y, r.max.x, t->screenr.min.y))) + if(!wcovered(w, Rect(r.min.x, r.min.y, r.max.x, t->screenr.min.y), i)) return 0; if(r.min.x < t->screenr.min.x) - if(!wcovered(w, Rect(r.min.x, r.min.y, t->screenr.min.x, r.max.y))) + if(!wcovered(w, Rect(r.min.x, r.min.y, t->screenr.min.x, r.max.y), i)) return 0; if(r.max.y > t->screenr.max.y) - if(!wcovered(w, Rect(r.min.x, t->screenr.max.y, r.max.x, r.max.y))) + if(!wcovered(w, Rect(r.min.x, t->screenr.max.y, r.max.x, r.max.y), i)) return 0; if(r.max.x > t->screenr.max.x) - if(!wcovered(w, Rect(t->screenr.max.x, r.min.y, r.max.x, r.max.y))) + if(!wcovered(w, Rect(t->screenr.max.x, r.min.y, r.max.x, r.max.y), i)) return 0; return 1; } @@ -696,7 +697,7 @@ button3menu(void) break; if(i < n || window[i]->deleted) continue; - if(wcovered(window[i], window[i]->screenr)){ + if(wcovered(window[i], window[i]->screenr, 0)){ hidden[n++] = window[i]; if(n >= nelem(hidden)) break; |