diff options
| author | moetunes <moetunes111@gmail.com> | 2011-10-08 12:28:37 +1000 |
|---|---|---|
| committer | moetunes <moetunes111@gmail.com> | 2011-10-08 12:28:37 +1000 |
| commit | eec5c61c28bb0219e1bf21c3c00ef4055aa4ba65 (patch) | |
| tree | 527abaff5ebb0924406234a7ad62dd05dead39ab | |
| parent | b217dfdd87395d8b1881390cd3ce200227d81612 (diff) | |
Single windows and fullscreen mode are borderless now
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/README | 2 | ||||
| -rwxr-xr-x | src/config.h | 2 | ||||
| -rwxr-xr-x | src/dminiwm.c | 28 |
4 files changed, 22 insertions, 13 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 08a9089..2b09ea0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,7 @@ 8/10/11 + For only one window or fullscreen mode there is no border + +8/10/11 Fixed fullscreen mplayer 8/10/11 @@ -11,7 +11,7 @@ See dminiwm.c or config.h for thanks and licensing. **dminiwm** is a very minimal and lightweight dynamic tiling window manager. I will try to stay under 1000 SLOC. - Currently under 900 lines with the config file included. + Currently under 1000 lines with the config file included. ###Modes diff --git a/src/config.h b/src/config.h index 3d5e200..f403fdd 100755 --- a/src/config.h +++ b/src/config.h @@ -1,4 +1,4 @@ - /* config.h for dminiwm.c [ 0.0.5 ] + /* config.h for dminiwm.c [ 0.0.6 ] * * Started from catwm 31/12/10 * Bad window error checking and numlock checking used from diff --git a/src/dminiwm.c b/src/dminiwm.c index 93a7c67..1b18bb6 100755 --- a/src/dminiwm.c +++ b/src/dminiwm.c @@ -1,4 +1,4 @@ -/* dminiwm.c [ 0.0.5 ] +/* dminiwm.c [ 0.0.6 ] * * I started this from catwm 31/12/10 * Bad window error checking and numlock checking used from @@ -428,7 +428,7 @@ void tile() { // If only one window if(head != NULL && head->next == NULL) { - XMoveResizeWindow(dis,head->win,0,y,sw-BORDER_WIDTH,sh-BORDER_WIDTH); + XMoveResizeWindow(dis,head->win,0,y,sw+2*BORDER_WIDTH,sh+2*BORDER_WIDTH); } else if(head != NULL) { switch(mode) { @@ -448,7 +448,7 @@ void tile() { break; case 1: /* Fullscreen */ for(c=head;c;c=c->next) { - XMoveResizeWindow(dis,c->win,0,y,sw-BORDER_WIDTH,sh-BORDER_WIDTH); + XMoveResizeWindow(dis,c->win,0,y,sw+2*BORDER_WIDTH,sh+2*BORDER_WIDTH); } break; case 2: /* Horizontal */ @@ -539,17 +539,21 @@ void tile() { void update_current() { client *c; - for(c=head;c;c=c->next) + for(c=head;c;c=c->next) { + if((head->next == NULL) || (mode == 1)) + XSetWindowBorderWidth(dis,c->win,0); + else + XSetWindowBorderWidth(dis,c->win,BORDER_WIDTH); + if(current == c) { // "Enable" current window - XSetWindowBorderWidth(dis,c->win,BORDER_WIDTH); XSetWindowBorder(dis,c->win,win_focus); XSetInputFocus(dis,c->win,RevertToParent,CurrentTime); XRaiseWindow(dis,c->win); } else XSetWindowBorder(dis,c->win,win_unfocus); - + } XSync(dis, False); } @@ -640,15 +644,17 @@ void configurerequest(XEvent *e) { XWindowChanges wc; wc.x = ev->x; wc.y = ev->y; - if(ev->width < sw) + if(ev->width < sw) { wc.width = ev->width; - else - wc.width = sw - BORDER_WIDTH; + } + else { + wc.width = sw-BORDER_WIDTH; + } if(ev->height < sh) wc.height = ev->height; else - wc.height = sh - BORDER_WIDTH; - wc.border_width = ev->border_width; + wc.height = sh-BORDER_WIDTH; + wc.border_width = 0; // ev->border_width; wc.sibling = ev->above; wc.stack_mode = ev->detail; XConfigureWindow(dis, ev->window, ev->value_mask, &wc); |
