diff options
| author | moetunes <moetunes111@gmail.com> | 2011-09-16 22:38:25 +1000 |
|---|---|---|
| committer | moetunes <moetunes111@gmail.com> | 2011-09-16 22:38:25 +1000 |
| commit | afd67678f9ba9abe567008ed59eff57e5795a4ff (patch) | |
| tree | 455043d8389097a5a16ebeef0b30ee5aadc35a6a | |
| parent | 125486c0ad73f5f4c58d4900f6b469a5cf6006a7 (diff) | |
Added back the option to have the panel at the top and fine tuned the grid tiling mode
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/README | 1 | ||||
| -rwxr-xr-x | src/config.h | 1 | ||||
| -rwxr-xr-x | src/dminiwm.c | 35 |
4 files changed, 25 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 50f941d..feb72b5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +16/9/11 + Added back the option to have the panel at the top + Fine tuned the grid tiling mode + 13/9/11 Added back horizontal tiling, follow mouse and follow window @@ -98,5 +98,4 @@ Need Xlib, then: * Sort out grid tiling mode without any useless gaps * Fix mplayer full screen window sizing * Have no window borders in fullscreen mode - * Add option to have a panel at the top diff --git a/src/config.h b/src/config.h index 111da44..4c1dbc2 100755 --- a/src/config.h +++ b/src/config.h @@ -34,6 +34,7 @@ #define DEFAULT_MODE 0 /* 0 = Vertical, 1 = Fullscreen */ #define FOLLOW_MOUSE 0 /* 1=Don't 0=Focus the window the mouse just entered */ #define FOLLOW_WINDOW 0 /* 1=Don't 0=Follow the window when moved to a different desktop */ +#define TOP_PANEL 1 /* 1=Don't 0=Have the panel at the top instead of the bottom */ // Colors #define FOCUS "#664422" // dkorange diff --git a/src/dminiwm.c b/src/dminiwm.c index ab2cc70..0087adc 100755 --- a/src/dminiwm.c +++ b/src/dminiwm.c @@ -419,49 +419,54 @@ void tile() { client *c; int n = 0; int x = 0; + int y = 0; + + // For a top panel + if(TOP_PANEL == 0) + y = PANEL_HEIGHT; + // If only one window if(head != NULL && head->next == NULL) { - XMoveResizeWindow(dis,head->win,0,0,sw-BORDER_WIDTH,sh-BORDER_WIDTH); + XMoveResizeWindow(dis,head->win,0,y,sw-BORDER_WIDTH,sh-BORDER_WIDTH); } else if(head != NULL) { switch(mode) { case 0: /* Vertical */ // Master window - XMoveResizeWindow(dis,head->win,0,0,master_size - BORDER_WIDTH,sh - BORDER_WIDTH); + XMoveResizeWindow(dis,head->win,0,y,master_size - BORDER_WIDTH,sh - BORDER_WIDTH); // Stack for(c=head->next;c;c=c->next) ++n; if(n == 1) growth = 0; - XMoveResizeWindow(dis,head->next->win,master_size + BORDER_WIDTH,0,sw-master_size-(2*BORDER_WIDTH),(sh/n)+growth - BORDER_WIDTH); - x = (sh/n)+growth; + XMoveResizeWindow(dis,head->next->win,master_size + BORDER_WIDTH,y,sw-master_size-(2*BORDER_WIDTH),(sh/n)+growth - BORDER_WIDTH); + y += (sh/n)+growth; for(c=head->next->next;c;c=c->next) { - XMoveResizeWindow(dis,c->win,master_size + BORDER_WIDTH,x,sw-master_size-(2*BORDER_WIDTH),(sh/n)-(growth/(n-1)) - BORDER_WIDTH); - x += (sh/n)-(growth/(n-1)); + XMoveResizeWindow(dis,c->win,master_size + BORDER_WIDTH,y,sw-master_size-(2*BORDER_WIDTH),(sh/n)-(growth/(n-1)) - BORDER_WIDTH); + y += (sh/n)-(growth/(n-1)); } break; case 1: /* Fullscreen */ for(c=head;c;c=c->next) { - XMoveResizeWindow(dis,c->win,0,0,sw-BORDER_WIDTH,sh-BORDER_WIDTH); + XMoveResizeWindow(dis,c->win,0,y,sw-BORDER_WIDTH,sh-BORDER_WIDTH); } break; case 2: /* Horizontal */ // Master window - XMoveResizeWindow(dis,head->win,0,0,sw-BORDER_WIDTH,master_size - BORDER_WIDTH); + XMoveResizeWindow(dis,head->win,0,y,sw-BORDER_WIDTH,master_size - BORDER_WIDTH); // Stack for(c=head->next;c;c=c->next) ++n; if(n == 1) growth = 0; - XMoveResizeWindow(dis,head->next->win,0,master_size + BORDER_WIDTH,(sw/n)+growth-BORDER_WIDTH,sh-master_size-(2*BORDER_WIDTH)); + XMoveResizeWindow(dis,head->next->win,0,y+master_size + BORDER_WIDTH,(sw/n)+growth-BORDER_WIDTH,sh-master_size-(2*BORDER_WIDTH)); x = (sw/n)+growth; for(c=head->next->next;c;c=c->next) { - XMoveResizeWindow(dis,c->win,x,master_size + BORDER_WIDTH,(sw/n)-(growth/(n-1)) - BORDER_WIDTH,sh-master_size-(2*BORDER_WIDTH)); + XMoveResizeWindow(dis,c->win,x,y+master_size + BORDER_WIDTH,(sw/n)-(growth/(n-1)) - BORDER_WIDTH,sh-master_size-(2*BORDER_WIDTH)); x += (sw/n)-(growth/(n-1)); } break; case 3: { // Grid int xpos = 0; - int y = 0; int wdt = 0; int ht = 0; @@ -495,22 +500,22 @@ void tile() { if((n == 3) || (n == 6)) xpos = (2*(sw/3)) + BORDER_WIDTH; if(n == 4) - y = (sh/2) + BORDER_WIDTH; + y += (sh/2); // + BORDER_WIDTH; } else { if(n > 2) ht = (sh/x) - 2*BORDER_WIDTH; else - ht = sh/x; + ht = (sh/x)-BORDER_WIDTH; if((n == 1) || (n == 3)) { xpos = 0; wdt = master_size - BORDER_WIDTH; } if((n == 2) || (n == 4)) { xpos = master_size+BORDER_WIDTH; - wdt = (sw - master_size) - BORDER_WIDTH; + wdt = (sw - master_size) - 2*BORDER_WIDTH; } if(n == 3) - y += (sh/x)+2*BORDER_WIDTH; + y += (sh/x)+BORDER_WIDTH; } XMoveResizeWindow(dis,c->win,xpos,y,wdt,ht); } |
