aboutsummaryrefslogtreecommitdiff
path: root/src/dminiwm.c
diff options
context:
space:
mode:
authormoetunes <moetunes111@gmail.com>2011-10-08 08:17:06 +1000
committermoetunes <moetunes111@gmail.com>2011-10-08 08:17:06 +1000
commit32c53ce236ea46124ccd5f715ff0e0c14d6c3c2f (patch)
tree7b82b2d0be89818a48ea3e45f5cf20c44e48dc42 /src/dminiwm.c
parentafd67678f9ba9abe567008ed59eff57e5795a4ff (diff)
Removed useless gaps from grid mode
Diffstat (limited to 'src/dminiwm.c')
-rwxr-xr-xsrc/dminiwm.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/dminiwm.c b/src/dminiwm.c
index 0087adc..7a5b0e4 100755
--- a/src/dminiwm.c
+++ b/src/dminiwm.c
@@ -1,4 +1,4 @@
-/* dminiwm.c [ 0.0.2 ]
+/* dminiwm.c [ 0.0.5 ]
*
* I started this from catwm 31/12/10
* Bad window error checking and numlock checking used from
@@ -469,13 +469,13 @@ void tile() {
int xpos = 0;
int wdt = 0;
int ht = 0;
+ int nwin = 0;
for(c=head;c;c=c->next) {
- ++n;
- if((n == 1) || (n == 3) || (n == 5) || (n == 7))
+ ++nwin;
+ if((nwin == 1) || (nwin == 3) || (nwin == 5) || (nwin == 7))
x += 1;
}
- n = 0;
for(c=head;c;c=c->next) {
++n;
if(x == 4) {
@@ -489,6 +489,10 @@ void tile() {
xpos = (2*(sw/3)) + BORDER_WIDTH;
if((n == 4) || (n == 7))
y += (sh/3) + BORDER_WIDTH;
+ if((n == nwin) && (n == 7))
+ wdt = sw - BORDER_WIDTH;
+ if((n == nwin) && (n == 8))
+ wdt = 2*sw/3 - BORDER_WIDTH;
} else
if(x == 3) {
wdt = (sw/3) - BORDER_WIDTH;
@@ -501,6 +505,9 @@ void tile() {
xpos = (2*(sw/3)) + BORDER_WIDTH;
if(n == 4)
y += (sh/2); // + BORDER_WIDTH;
+ if((n == nwin) && (n == 5))
+ wdt = 2*sw/3 - BORDER_WIDTH;
+
} else {
if(n > 2)
ht = (sh/x) - 2*BORDER_WIDTH;
@@ -516,6 +523,8 @@ void tile() {
}
if(n == 3)
y += (sh/x)+BORDER_WIDTH;
+ if((n == nwin) && (n == 3))
+ wdt = sw - BORDER_WIDTH;
}
XMoveResizeWindow(dis,c->win,xpos,y,wdt,ht);
}