view.c
changeset 473 2d8af0d7920d
parent 463 e93b0ad5aeb5
child 479 de69a7b0c8fa
--- a/view.c	Wed Sep 20 09:53:21 2006 +0200
+++ b/view.c	Fri Sep 22 07:37:56 2006 +0200
@@ -61,8 +61,6 @@
 dofloat(Arg *arg) {
 	Client *c;
 
-	maximized = False;
-
 	for(c = clients; c; c = c->next) {
 		if(isvisible(c)) {
 			resize(c, True, TopLeft);
@@ -82,8 +80,6 @@
 	int h, i, n, w;
 	Client *c;
 
-	maximized = False;
-
 	w = sw - mw;
 	for(n = 0, c = clients; c; c = c->next)
 		if(isvisible(c) && !c->isfloat)
@@ -190,7 +186,7 @@
 	for(n = 0, c = clients; c; c = c->next)
 		if(isvisible(c) && !c->isfloat)
 			n++;
-	if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
+	if(!sel || sel->isfloat || n < 2 || (arrange != dotile))
 		return;
 
 	if(sel == getnext(clients)) {
@@ -273,13 +269,28 @@
 
 void
 zoom(Arg *arg) {
+	int tmp;
 	unsigned int n;
 	Client *c;
+	XEvent ev;
+
+	if(!sel)
+		return;
+
+	if(sel->isfloat || (arrange == dofloat)) {
+		tmp = sel->x; sel->x = sel->rx; sel->rx = tmp;
+		tmp = sel->y; sel->y = sel->ry; sel->ry = tmp;
+		tmp = sel->w; sel->w = sel->rw; sel->rw = tmp;
+		tmp = sel->h; sel->h = sel->rh; sel->rh = tmp;
+		resize(sel, True, TopLeft);
+		while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+		return;
+	}
 
 	for(n = 0, c = clients; c; c = c->next)
 		if(isvisible(c) && !c->isfloat)
 			n++;
-	if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized)
+	if(n < 2 || (arrange != dotile))
 		return;
 
 	if((c = sel) == nexttiled(clients))