about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-06-12 23:04:55 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-06-12 23:04:55 +0100
commit1f1a1327847c3beedcbc7b57085a8deb8e8ec1f5 (patch)
tree21110916cb82c7a75123b672723cc8d074928cbe
parent512541bfbd499b1c10a05aaa795967ebb5fb9493 (diff)
downloaddwm-1f1a1327847c3beedcbc7b57085a8deb8e8ec1f5.tar.gz
fixed tag click handling, however ClkRootWin doesn't work for me
-rw-r--r--dwm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index d531965..d13a7a2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -59,8 +59,8 @@ enum { CurNormal, CurResize, CurMove, CurLast };        /* cursor */
 enum { ColBorder, ColFG, ColBG, ColLast };              /* color */
 enum { NetSupported, NetWMName, NetLast };              /* EWMH atoms */
 enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
-enum { ClkLtSymbol = -1, ClkStatusText = -2, ClkWinTitle = -3,
-       ClkClientWin = -4, ClkRootWin = -5, ClkLast = -6};/* clicks */
+enum { ClkLtSymbol = 64, ClkStatusText, ClkWinTitle,
+       ClkClientWin, ClkRootWin, ClkLast };             /* clicks */
 
 /* typedefs */
 typedef unsigned int uint;
@@ -314,11 +314,12 @@ buttonpress(XEvent *e) {
 
 	click = ClkRootWin;
 	if(ev->window == barwin) {
-		x = 0;
-		for(i = 0; i < LENGTH(tags) && ev->x >= x; i++)
+		i = x = 0;
+		do
 			x += TEXTW(tags[i]);
-		if(i < LENGTH(tags) || ev->x <= x)
-			click = i - 1;
+		while(ev->x >= x && ++i < LENGTH(tags));
+		if(i < LENGTH(tags))
+			click = i;
 		else if(ev->x < x + blw)
 			click = ClkLtSymbol;
 		else if(ev->x > wx + ww - TEXTW(stext))
#n9'>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