about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c53
1 files changed, 38 insertions, 15 deletions
diff --git a/client.c b/client.c
index 889daa5..1bdebd2 100644
--- a/client.c
+++ b/client.c
@@ -70,6 +70,9 @@ focusnext(Arg *arg)
 	if(!sel)
 		return;
 
+	if(sel->ismax)
+		togglemax(NULL);
+
 	if(!(c = getnext(sel->next, tsel)))
 		c = getnext(clients, tsel);
 	if(c) {
@@ -87,6 +90,9 @@ focusprev(Arg *arg)
 	if(!sel)
 		return;
 
+	if(sel->ismax)
+		togglemax(NULL);
+
 	if((c = sel->revert && sel->revert->tags[tsel] ? sel->revert : NULL)) {
 		higher(c);
 		focus(c);
@@ -234,8 +240,6 @@ manage(Window w, XWindowAttributes *wa)
 	c->next = clients;
 	clients = c;
 
-	XGrabButton(dpy, Button1, ControlMask, c->win, False, ButtonPressMask,
-			GrabModeAsync, GrabModeSync, None, None);
 	XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask,
 			GrabModeAsync, GrabModeSync, None, None);
 	XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask,
@@ -264,19 +268,6 @@ manage(Window w, XWindowAttributes *wa)
 }
 
 void
-maximize(Arg *arg)
-{
-	if(!sel)
-		return;
-	sel->x = sx;
-	sel->y = sy + bh;
-	sel->w = sw - 2 * sel->border;
-	sel->h = sh - 2 * sel->border - bh;
-	higher(sel);
-	resize(sel, False, TopLeft);
-}
-
-void
 pop(Client *c)
 {
 	Client **l;
@@ -405,6 +396,38 @@ settitle(Client *c)
 }
 
 void
+togglemax(Arg *arg)
+{
+	int ox, oy, ow, oh;
+	XEvent ev;
+
+	if(!sel)
+		return;
+
+	if((sel->ismax = !sel->ismax)) {
+		ox = sel->x;
+		oy = sel->y;
+		ow = sel->w;
+		oh = sel->h;
+		sel->x = sx;
+		sel->y = sy + bh;
+		sel->w = sw - 2 * sel->border;
+		sel->h = sh - 2 * sel->border - bh;
+
+		higher(sel);
+		resize(sel, False, TopLeft);
+
+		sel->x = ox;
+		sel->y = oy;
+		sel->w = ow;
+		sel->h = oh;
+	}
+	else
+		resize(sel, False, TopLeft);
+	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+}
+
+void
 unmanage(Client *c)
 {
 	Client **l;
/cpp/014boolean?h=hlt&id=42b31beba71db2012db3ea47f4ca8cfc18136d14'>^
c7c822b2 ^

98f7918b ^
c7c822b2 ^

98f7918b ^



c7c822b2 ^
98f7918b ^








6f5d7864 ^
98f7918b ^





d7e11237 ^




f7051fad ^
d7e11237 ^


c7c822b2 ^

d7e11237 ^



c7c822b2 ^
d7e11237 ^







6f5d7864 ^
d7e11237 ^



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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99