diff options
| -rw-r--r-- | client.c | 10 | ||||
| -rw-r--r-- | config.mk | 2 | ||||
| -rw-r--r-- | dwm.h | 3 | ||||
| -rw-r--r-- | event.c | 2 | ||||
| -rw-r--r-- | view.c | 9 |
5 files changed, 19 insertions, 7 deletions
| @@ -68,6 +68,14 @@ xerrordummy(Display *dsply, XErrorEvent *ee) { | |||
| 68 | /* extern */ | 68 | /* extern */ |
| 69 | 69 | ||
| 70 | void | 70 | void |
| 71 | ban(Client *c) { | ||
| 72 | if(!c || c->isbanned) | ||
| 73 | return; | ||
| 74 | c->isbanned = True; | ||
| 75 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 76 | } | ||
| 77 | |||
| 78 | void | ||
| 71 | configure(Client *c) { | 79 | configure(Client *c) { |
| 72 | XConfigureEvent ce; | 80 | XConfigureEvent ce; |
| 73 | 81 | ||
| @@ -190,7 +198,7 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 190 | c->next = clients; | 198 | c->next = clients; |
| 191 | c->snext = stack; | 199 | c->snext = stack; |
| 192 | stack = clients = c; | 200 | stack = clients = c; |
| 193 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 201 | ban(c); |
| 194 | XMapWindow(dpy, c->win); | 202 | XMapWindow(dpy, c->win); |
| 195 | setclientstate(c, NormalState); | 203 | setclientstate(c, NormalState); |
| 196 | if(isvisible(c)) | 204 | if(isvisible(c)) |
| @@ -1,5 +1,5 @@ | |||
| 1 | # dwm version | 1 | # dwm version |
| 2 | VERSION = 3.5 | 2 | VERSION = 3.6 |
| 3 | 3 | ||
| 4 | # Customize below to fit your system | 4 | # Customize below to fit your system |
| 5 | 5 | ||
| @@ -73,7 +73,7 @@ struct Client { | |||
| 73 | int minax, minay, maxax, maxay; | 73 | int minax, minay, maxax, maxay; |
| 74 | long flags; | 74 | long flags; |
| 75 | unsigned int border; | 75 | unsigned int border; |
| 76 | Bool isfixed, isfloat, ismax; | 76 | Bool isbanned, isfixed, isfloat, ismax; |
| 77 | Bool *tags; | 77 | Bool *tags; |
| 78 | Client *next; | 78 | Client *next; |
| 79 | Client *prev; | 79 | Client *prev; |
| @@ -99,6 +99,7 @@ extern Display *dpy; | |||
| 99 | extern Window root, barwin; | 99 | extern Window root, barwin; |
| 100 | 100 | ||
| 101 | /* client.c */ | 101 | /* client.c */ |
| 102 | extern void ban(Client *c); /* ban c */ | ||
| 102 | extern void configure(Client *c); /* send synthetic configure event */ | 103 | extern void configure(Client *c); /* send synthetic configure event */ |
| 103 | extern void focus(Client *c); /* focus c, c may be NULL */ | 104 | extern void focus(Client *c); /* focus c, c may be NULL */ |
| 104 | extern Client *getclient(Window w); /* return client of w */ | 105 | extern Client *getclient(Window w); /* return client of w */ |
| @@ -189,7 +189,7 @@ configurerequest(XEvent *e) { | |||
| 189 | configure(c); | 189 | configure(c); |
| 190 | resize(c, False); | 190 | resize(c, False); |
| 191 | if(!isvisible(c)) | 191 | if(!isvisible(c)) |
| 192 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 192 | ban(c); |
| 193 | } | 193 | } |
| 194 | else | 194 | else |
| 195 | configure(c); | 195 | configure(c); |
| @@ -55,10 +55,12 @@ dofloat(void) { | |||
| 55 | Client *c; | 55 | Client *c; |
| 56 | 56 | ||
| 57 | for(c = clients; c; c = c->next) { | 57 | for(c = clients; c; c = c->next) { |
| 58 | if(isvisible(c)) | 58 | if(isvisible(c)) { |
| 59 | c->isbanned = False; | ||
| 59 | resize(c, True); | 60 | resize(c, True); |
| 61 | } | ||
| 60 | else | 62 | else |
| 61 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 63 | ban(c); |
| 62 | } | 64 | } |
| 63 | if(!sel || !isvisible(sel)) { | 65 | if(!sel || !isvisible(sel)) { |
| 64 | for(c = stack; c && !isvisible(c); c = c->snext); | 66 | for(c = stack; c && !isvisible(c); c = c->snext); |
| @@ -82,6 +84,7 @@ dotile(void) { | |||
| 82 | 84 | ||
| 83 | for(i = 0, c = clients; c; c = c->next) | 85 | for(i = 0, c = clients; c; c = c->next) |
| 84 | if(isvisible(c)) { | 86 | if(isvisible(c)) { |
| 87 | c->isbanned = False; | ||
| 85 | if(c->isfloat) { | 88 | if(c->isfloat) { |
| 86 | resize(c, True); | 89 | resize(c, True); |
| 87 | continue; | 90 | continue; |
| @@ -108,7 +111,7 @@ dotile(void) { | |||
| 108 | i++; | 111 | i++; |
| 109 | } | 112 | } |
| 110 | else | 113 | else |
| 111 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 114 | ban(c); |
| 112 | if(!sel || !isvisible(sel)) { | 115 | if(!sel || !isvisible(sel)) { |
| 113 | for(c = stack; c && !isvisible(c); c = c->snext); | 116 | for(c = stack; c && !isvisible(c); c = c->snext); |
| 114 | focus(c); | 117 | focus(c); |
