comparison layout.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 ba504f41828f
children e060ab82b136
comparison
equal deleted inserted replaced
1:6b3f27f35280 2:49d41869cdb0
231 for(rows = 0; rows <= n/2; rows++) 231 for(rows = 0; rows <= n/2; rows++)
232 if(rows*rows >= n) 232 if(rows*rows >= n)
233 break; 233 break;
234 cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows; 234 cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;
235 235
236 th = (sh - dc.h) / (rows ? rows : 1); 236 th = wah / (rows ? rows : 1);
237 tw = sw / (cols ? cols : 1); 237 tw = waw / (cols ? cols : 1);
238 nw = tw - 2 * BORDERPX; 238 nw = tw - 2 * BORDERPX;
239 nh = th - 2 * BORDERPX; 239 nh = th - 2 * BORDERPX;
240 240
241 for(i = 0, c = clients; c; c = c->next) 241 for(i = 0, c = clients; c; c = c->next)
242 if(isvisible(c)) { 242 if(isvisible(c)) {
247 continue; 247 continue;
248 c->ismax = False; 248 c->ismax = False;
249 nx = (i / rows) * tw; 249 nx = (i / rows) * tw;
250 ny = (i % rows) * th + (TOPBAR ? dc.h : 0); 250 ny = (i % rows) * th + (TOPBAR ? dc.h : 0);
251 /* adjust height and width of last row's and last column's windows */ 251 /* adjust height and width of last row's and last column's windows */
252 ah = ((i + 1) % rows == 0) ? sh - th * rows - dc.h : 0; 252 ah = ((i + 1) % rows == 0) ? wah - th * rows : 0;
253 aw = (i >= rows * (cols - 1)) ? sw - tw * cols : 0; 253 aw = (i >= rows * (cols - 1)) ? waw - tw * cols : 0;
254 resize(c, nx, ny, nw + aw, nh + ah, False); 254 resize(c, nx, ny, nw + aw, nh + ah, False);
255 i++; 255 i++;
256 } 256 }
257 else { 257 else {
258 c->isbanned = True; 258 c->isbanned = True;