about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'event.c')
-rw-r--r--event.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/event.c b/event.c
index a719bf2..e5ea712 100644
--- a/event.c
+++ b/event.c
@@ -109,19 +109,17 @@ buttonpress(XEvent *e)
 		for(a.i = 0; a.i < ntags; a.i++) {
 			x += textw(tags[a.i]);
 			if(ev->x < x) {
-				switch(ev->button) {
-				case Button1:
+				if(ev->button == Button1) {
 					if(ev->state & MODKEY)
 						tag(&a);
 					else
 						view(&a);
-					break;
-				case Button3:
+				}
+				else if(ev->button == Button3) {
 					if(ev->state & MODKEY)
 						toggletag(&a);
 					else
 						toggleview(&a);
-					break;
 				}
 				return;
 			}
@@ -133,26 +131,17 @@ buttonpress(XEvent *e)
 	}
 	else if((c = getclient(ev->window))) {
 		focus(c);
-		if(CLEANMASK(ev->state) != MODKEY)
+		if(c->ismax || CLEANMASK(ev->state) != MODKEY)
 			return;
-		switch(ev->button) {
-		default:
-			break;
-		case Button1:
-			if(!c->ismax && (arrange == dofloat || c->isfloat)) {
-				restack(c);
-				movemouse(c);
-			}
-			break;
-		case Button2:
+		if((ev->button == Button1) && ((arrange == dofloat) || c->isfloat)) {
+			restack(c);
+			movemouse(c);
+		}
+		else if(ev->button == Button2)
 			zoom(NULL);
-			break;
-		case Button3:
-			if(!c->ismax && (arrange == dofloat || c->isfloat)) {
-				restack(c);
-				resizemouse(c);
-			}
-			break;
+		else if(ev->button == Button3 && ((arrange == dofloat) || c->isfloat)) {
+			restack(c);
+			resizemouse(c);
 		}
 	}
 }
?id=6bd78b38830217fa268e678d9637116ec516bf0e'>^
e087f6d4





c3ec4181 ^

e087f6d4



c3ec4181 ^



e087f6d4

c3ec4181 ^

e087f6d4
















c3ec4181 ^

e087f6d4


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