diff options
| author | moetunes <moetunes111@gmail.com> | 2011-10-13 20:15:14 +1000 |
|---|---|---|
| committer | moetunes <moetunes111@gmail.com> | 2011-10-13 20:15:14 +1000 |
| commit | cfd3f3630e5779475e1f0b48af7d04ed3d0a0271 (patch) | |
| tree | e09b642e6c99d00d3f2ea94fd60cc743eda712c2 /src | |
| parent | 72770204f7916cf4611375b9909f620b5765dac0 (diff) | |
Added option to use grow_window for 3-4 windows in grid mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/dminiwm.c | 32 |
2 files changed, 19 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e789e55..c9c0fbd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,7 @@ 13/10/11 + Added ability to use grow_window/shrink_window in grid mode with 3 or 4 windows + +13/10/11 Popup windows now aren't managed/added to the stack 10/10/11 diff --git a/src/dminiwm.c b/src/dminiwm.c index 437e994..321b3c7 100644 --- a/src/dminiwm.c +++ b/src/dminiwm.c @@ -467,16 +467,12 @@ void tile() { int xpos = 0; int wdt = 0; int ht = 0; - int nwin = 0; - for(c=head;c;c=c->next) { - ++nwin; - if((nwin == 1) || (nwin == 3) || (nwin == 5) || (nwin == 7)) - x += 1; - } + for(c=head;c;c=c->next) ++x; + for(c=head;c;c=c->next) { ++n; - if(x == 4) { + if(x >= 7) { wdt = (sw/3) - BORDER_WIDTH; ht = (sh/3) - BORDER_WIDTH; if((n == 1) || (n == 4) || (n == 7)) @@ -487,12 +483,12 @@ void tile() { xpos = (2*(sw/3)) + BORDER_WIDTH; if((n == 4) || (n == 7)) y += (sh/3) + BORDER_WIDTH; - if((n == nwin) && (n == 7)) + if((n == x) && (n == 7)) wdt = sw - BORDER_WIDTH; - if((n == nwin) && (n == 8)) + if((n == x) && (n == 8)) wdt = 2*sw/3 - BORDER_WIDTH; } else - if(x == 3) { + if(x >= 5) { wdt = (sw/3) - BORDER_WIDTH; ht = (sh/2) - BORDER_WIDTH; if((n == 1) || (n == 4)) @@ -503,14 +499,18 @@ void tile() { xpos = (2*(sw/3)) + BORDER_WIDTH; if(n == 4) y += (sh/2); // + BORDER_WIDTH; - if((n == nwin) && (n == 5)) + if((n == x) && (n == 5)) wdt = 2*sw/3 - BORDER_WIDTH; } else { - if(n > 2) - ht = (sh/x) - 2*BORDER_WIDTH; + if(x > 2) { + if((n == 1) || (n == 2)) + ht = (sh/2) + growth - BORDER_WIDTH; + if(n >= 3) + ht = (sh/2) - growth - 2*BORDER_WIDTH; + } else - ht = (sh/x)-BORDER_WIDTH; + ht = sh - BORDER_WIDTH; if((n == 1) || (n == 3)) { xpos = 0; wdt = master_size - BORDER_WIDTH; @@ -520,8 +520,8 @@ void tile() { wdt = (sw - master_size) - 2*BORDER_WIDTH; } if(n == 3) - y += (sh/x)+BORDER_WIDTH; - if((n == nwin) && (n == 3)) + y += (sh/2) + growth + BORDER_WIDTH; + if((n == x) && (n == 3)) wdt = sw - BORDER_WIDTH; } XMoveResizeWindow(dis,c->win,xpos,y,wdt,ht); |
