fixed Gottox' buttonpress/ClkTagBar code
authorAnselm R Garbe <garbeam@gmail.com>
Sat, 21 Jun 2008 12:49:43 +0000 (13:49 +0100)
committerAnselm R Garbe <garbeam@gmail.com>
Sat, 21 Jun 2008 12:49:43 +0000 (13:49 +0100)
dwm.c

diff --git a/dwm.c b/dwm.c
index a5a9de2..d4ce1e4 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -310,8 +310,8 @@ buttonpress(XEvent *e) {
 
        click = ClkRootWin;
        if(ev->window == barwin) {
 
        click = ClkRootWin;
        if(ev->window == barwin) {
-               for(i = x = 0; ev->x >= x && ++i < LENGTH(tags); i++)
-                       x += TEXTW(tags[i]);
+               i = x = 0;
+               do x += TEXTW(tags[i]); while(ev->x >= x && ++i < LENGTH(tags));
                if(i < LENGTH(tags)) {
                        click = ClkTagBar;
                        arg.ui = 1 << i;
                if(i < LENGTH(tags)) {
                        click = ClkTagBar;
                        arg.ui = 1 << i;