On Sep 28, 2008, at 12:37 PM, Valentin wrote:

Hi,

can somebody tell me how to change the latest grid layout patch to put
the clients in two columns and one row instead of two rows and one
column when there are only two clients in a tag? [1] The current way of
doing it isn't very nice on widescreen monitors...

Change the follow block in grid():
+       /* grid dimensions */
+       for(rows = 0; rows <= n/2; rows++)
+               if(rows*rows >= n)
+                       break;
+       cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;

Where it says 'rows', it should say 'cols', and vice versa. But really, this also sucks if you have 100 windows, as it forces a 10x10 grid regardless of screen dimensions. Something like:
        k    = some constant, maybe mfact?
        rows = (int) floor(sqrt(n * k));
        cols = (int) ceil((double) n / rows);
is both cleaner and more general, IMHO.

Reply via email to