Mercurial > hg > index.fcgi > dwm > dwm-3.6.1-12pba
diff event.c @ 4:a54de16f8277
fix taskbar behavior when exceeding MAX_TASKS; bound moveresize() to windowarea
author | paulo@localhost |
---|---|
date | Fri, 24 Apr 2009 01:34:17 -0700 |
parents | faa4cb9d7bd6 |
children | 0968b3739b8d |
line diff
1.1 --- a/event.c Thu Apr 23 02:43:13 2009 -0700 1.2 +++ b/event.c Fri Apr 24 01:34:17 2009 -0700 1.3 @@ -167,18 +167,18 @@ 1.4 } 1.5 else if(tbarwin == ev->window) { 1.6 int i, w; 1.7 + for(i=0, c = clients; c; c = c->next) { 1.8 + if(isvisible(c)) 1.9 + i++; 1.10 + } 1.11 + if(!i || i >= MAX_TASKS) 1.12 + return; 1.13 + else 1.14 + w = sw/i; 1.15 switch(ev->button) { 1.16 case Button4: focusprev(NULL); return; break; 1.17 case Button5: focusnext(NULL); return; break; 1.18 } 1.19 - for(i=0, c = clients; c; c = c->next) { 1.20 - if(isvisible(c)) 1.21 - i++; 1.22 - } 1.23 - if(!i && i >= MAX_TASKS) 1.24 - return; 1.25 - else 1.26 - w = sw/i; 1.27 for(i=1, c = clients; c && i*w<=sw; c = c->next, i++) { 1.28 for(; c && !isvisible(c); c = c->next); 1.29 if(i*w > ev->x) {