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.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/event.c b/event.c
index 35cd4f9..3c83aa8 100644
--- a/event.c
+++ b/event.c
@@ -105,21 +105,19 @@ buttonpress(XEvent *e)
 	XButtonPressedEvent *ev = &e->xbutton;
 
 	if(barwin == ev->window) {
-		if(ev->x < modew)
-			togglemode(NULL);
-		else {
-			x = modew;
-			for(a.i = 0; a.i < ntags; a.i++) {
-				x += textw(tags[a.i]);
-				if(ev->x < x) {
-					if(ev->button == Button1)
-						view(&a);
-					else if(ev->button == Button3)
-						toggleview(&a);
-					return;
-				}
+		x = 0;
+		for(a.i = 0; a.i < ntags; a.i++) {
+			x += textw(tags[a.i]);
+			if(ev->x < x) {
+				if(ev->button == Button1)
+					view(&a);
+				else if(ev->button == Button3)
+					toggleview(&a);
+				return;
 			}
 		}
+		if(ev->x < x + bmw)
+			togglemode(NULL);
 	}
 	else if((c = getclient(ev->window))) {
 		focus(c);
ption' href='/acidbong/suckless/dwm/commit/README?h=4.0&id=650a1fb4e1a798aca48a53739f5bb2649191bc1c'>650a1fb ^
01a8d44 ^
650a1fb ^
1076f2b
650a1fb ^
1076f2b
650a1fb ^
1076f2b

650a1fb ^
1076f2b
eff4478 ^
1076f2b
7b5638f ^

98c6a92 ^
98c6a92 ^


7b5638f ^
2b66f7a ^
98c6a92 ^
7b5638f ^
1076f2b

dc5c070 ^

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