comparison event.c @ 5:e060ab82b136

gapless grid
author paulo@thepaulopc
date Wed, 27 Jan 2010 23:28:29 -0800
parents faa4cb9d7bd6
children
comparison
equal deleted inserted replaced
2:94fa084f0eb6 3:1282da32047b
165 case Button5: pushdown(NULL); break; 165 case Button5: pushdown(NULL); break;
166 } 166 }
167 } 167 }
168 else if(tbarwin == ev->window) { 168 else if(tbarwin == ev->window) {
169 int i, w; 169 int i, w;
170 for(i=0, c = clients; c; c = c->next) {
171 if(isvisible(c))
172 i++;
173 }
174 if(!i || i >= MAX_TASKS)
175 return;
176 else
177 w = sw/i;
170 switch(ev->button) { 178 switch(ev->button) {
171 case Button4: focusprev(NULL); return; break; 179 case Button4: focusprev(NULL); return; break;
172 case Button5: focusnext(NULL); return; break; 180 case Button5: focusnext(NULL); return; break;
173 } 181 }
174 for(i=0, c = clients; c; c = c->next) {
175 if(isvisible(c))
176 i++;
177 }
178 if(!i && i >= MAX_TASKS)
179 return;
180 else
181 w = sw/i;
182 for(i=1, c = clients; c && i*w<=sw; c = c->next, i++) { 182 for(i=1, c = clients; c && i*w<=sw; c = c->next, i++) {
183 for(; c && !isvisible(c); c = c->next); 183 for(; c && !isvisible(c); c = c->next);
184 if(i*w > ev->x) { 184 if(i*w > ev->x) {
185 switch(ev->button) { 185 switch(ev->button) {
186 case Button1: focus(c); restack(); break; 186 case Button1: focus(c); restack(); break;