summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/man/4/rio5
-rw-r--r--sys/src/cmd/rio/wctl.c25
2 files changed, 20 insertions, 10 deletions
diff --git a/sys/man/4/rio b/sys/man/4/rio
index b0997bbef..caacd9552 100644
--- a/sys/man/4/rio
+++ b/sys/man/4/rio
@@ -258,14 +258,13 @@ The
.B top
and
.B bottom
-commands do not change whether the window is current or not;
-the others always make the affected window current.
-.IP
+commands do not change whether the window is current or not.
Neither
.B top
nor
.B bottom
has any options.
+.IP
The
.BR resize ,
.BR move ,
diff --git a/sys/src/cmd/rio/wctl.c b/sys/src/cmd/rio/wctl.c
index a19c5a4e8..cb5acb64a 100644
--- a/sys/src/cmd/rio/wctl.c
+++ b/sys/src/cmd/rio/wctl.c
@@ -360,22 +360,29 @@ wctlcmd(Window *w, Rectangle r, int cmd, char *err)
r = rectonscreen(r);
/* fall through */
case Resize:
- if(eqrect(r, w->screenr))
- return 1;
if(!goodrect(r)){
strcpy(err, Ebadwr);
return -1;
}
- if(w != input){
- strcpy(err, "window not current");
- return -1;
+ if(Dx(w->screenr) > 0){
+ if(eqrect(r, w->screenr))
+ return 1;
+ if(w != input){
+ strcpy(err, "window not current");
+ return -1;
+ }
+ i = allocwindow(wscreen, r, Refbackup, DNofill);
+ } else { /* hidden */
+ if(eqrect(r, w->i->r))
+ return 1;
+ i = allocimage(display, r, w->i->chan, 0, DNofill);
+ r = ZR;
}
- i = allocwindow(wscreen, r, Refbackup, DNofill);
if(i == nil){
strcpy(err, Ewalloc);
return -1;
}
- wsendctlmesg(w, Reshaped, i->r, i);
+ wsendctlmesg(w, Reshaped, r, i);
return 1;
case Scroll:
w->scrolling = 1;
@@ -393,6 +400,10 @@ wctlcmd(Window *w, Rectangle r, int cmd, char *err)
wbottomme(w);
return 1;
case Current:
+ if(Dx(w->screenr)<=0){
+ strcpy(err, "window is hidden");
+ return -1;
+ }
wtopme(w);
wcurrent(w);
return 1;