about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorarg@mmvi <unknown>2006-09-22 13:53:28 +0200
committerarg@mmvi <unknown>2006-09-22 13:53:28 +0200
commit346bdea946887d83f857a8944a0189bca51a3e47 (patch)
tree2e8a502e745df40c6042ea4e58dc5872c950a8f8
parent05c10c5776738fdfe73c1e66e14c869e2e5e338d (diff)
downloaddwm-346bdea946887d83f857a8944a0189bca51a3e47.tar.gz
small change to achieve Jukka's last proposal
-rw-r--r--dwm.h3
-rw-r--r--view.c45
2 files changed, 34 insertions, 14 deletions
diff --git a/dwm.h b/dwm.h
index 2298369..178aab8 100644
--- a/dwm.h
+++ b/dwm.h
@@ -77,12 +77,13 @@ struct Client {
 	char name[256];
 	int proto;
 	int x, y, w, h;
+	int rx, ry, rw, rh; /* revert geometry */
 	int tx, ty, tw, th; /* title window geometry */
 	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
 	int grav;
 	long flags; 
 	unsigned int border, weight;
-	Bool isfloat;
+	Bool isfloat, ismax;
 	Bool *tags;
 	Client *next;
 	Client *prev;
diff --git a/view.c b/view.c
index bb32235..5667134 100644
--- a/view.c
+++ b/view.c
@@ -18,6 +18,12 @@ minclient() {
 	return min;
 }
 
+static Client *
+nexttiled(Client *c) {
+	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
+	return c;
+}
+
 static void
 reorder() {
 	Client *c, *newclients, *tail;
@@ -36,10 +42,23 @@ reorder() {
 	clients = newclients;
 }
 
-static Client *
-nexttiled(Client *c) {
-	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
-	return c;
+static void
+togglemax(Client *c)
+{
+	if((c->ismax = !c->ismax)) {
+		c->rx = c->x; c->x = sx;
+		c->ry = c->y; c->y = bh;
+		c->rw = c->w; c->w = sw;
+		c->rh = c->h; c->h = sh;
+	}
+	else {
+		c->x = c->rx;
+		c->y = c->ry;
+		c->w = c->w;
+		c->h = c->h;
+	}
+	resize(c, True, TopLeft);
+	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
 
 /* extern */
@@ -82,8 +101,14 @@ dotile(Arg *arg) {
 
 	w = sw - mw;
 	for(n = 0, c = clients; c; c = c->next)
-		if(isvisible(c) && !c->isfloat)
-			n++;
+		if(isvisible(c)) {
+			if(c->isfloat) {
+				if(c->ismax)
+					togglemax(c);
+			}
+			else
+				n++;
+		}
 
 	if(n > 1)
 		h = (sh - bh) / (n - 1);
@@ -269,7 +294,6 @@ viewall(Arg *arg) {
 
 void
 zoom(Arg *arg) {
-	int tmp;
 	unsigned int n;
 	Client *c;
 	XEvent ev;
@@ -278,12 +302,7 @@ zoom(Arg *arg) {
 		return;
 
 	if(sel->isfloat || (arrange == dofloat)) {
-		sel->x = sx;
-		sel->y = bh;
-		sel->w = sw;
-		sel->h = sh - bh;
-		resize(sel, True, TopLeft);
-		while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+		togglemax(sel);
 		return;
 	}
 
mp;id=adaa28a6e600f636f5e86244ccef69e98419ba1a'>adaa28a ^
dc5d967 ^
adaa28a ^


849e631 ^
adaa28a ^

d4b7a9a ^
ca65478 ^
d4b7a9a ^
6651dd7 ^
d4b7a9a ^
6a3ae5e ^
d4b7a9a ^


adaa28a ^
ca65478 ^
9955ddc ^
dc5d967 ^
9955ddc ^

9955ddc ^
439e15d ^
4230932 ^

439e15d ^



16c67f3 ^
7711ab6 ^
e48de30 ^
439e15d ^

0464e42 ^
439e15d ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63