summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 */
59enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ 59enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
60enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */ 60enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
61enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */ 61enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
62enum { ClkLtSymbol = -1, ClkStatusText = -2, ClkWinTitle = -3, 62enum { ClkLtSymbol = 64, ClkStatusText, ClkWinTitle,
63 ClkClientWin = -4, ClkRootWin = -5, ClkLast = -6};/* clicks */ 63 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
64 64
65/* typedefs */ 65/* typedefs */
66typedef unsigned int uint; 66typedef unsigned int uint;
@@ -314,11 +314,12 @@ buttonpress(XEvent *e) {
314 314
315 click = ClkRootWin; 315 click = ClkRootWin;
316 if(ev->window == barwin) { 316 if(ev->window == barwin) {
317 x = 0; 317 i = x = 0;
318 for(i = 0; i < LENGTH(tags) && ev->x >= x; i++) 318 do
319 x += TEXTW(tags[i]); 319 x += TEXTW(tags[i]);
320 if(i < LENGTH(tags) || ev->x <= x) 320 while(ev->x >= x && ++i < LENGTH(tags));
321 click = i - 1; 321 if(i < LENGTH(tags))
322 click = i;
322 else if(ev->x < x + blw) 323 else if(ev->x < x + blw)
323 click = ClkLtSymbol; 324 click = ClkLtSymbol;
324 else if(ev->x > wx + ww - TEXTW(stext)) 325 else if(ev->x > wx + ww - TEXTW(stext))