summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-07-28 17:18:45 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-07-28 17:18:45 +0200
commita54cf2ecef2ca83441dccd454c694b92bca42a16 (patch)
treed793de29a6ceeafba2d0030c64a076d5dfd6ffa8
parentremoved shiftview(), if you scroll the views in the tag area, you can also us... (diff)
downloaddwm-a54cf2ecef2ca83441dccd454c694b92bca42a16.tar.gz
dwm-a54cf2ecef2ca83441dccd454c694b92bca42a16.zip
changed ban/unban implementation to not move the windows anymore, but map/unmap them instead - PLEASE TEST THIS
Diffstat (limited to '')
-rw-r--r--client.c17
-rw-r--r--config.mk2
-rw-r--r--dwm.h1
-rw-r--r--event.c6
4 files changed, 15 insertions, 11 deletions
diff --git a/client.c b/client.c
index 68d10a7..85b1af8 100644
--- a/client.c
+++ b/client.c
@@ -98,10 +98,12 @@ attach(Client *c) {
98 98
99void 99void
100ban(Client *c) { 100ban(Client *c) {
101 if (c->isbanned) 101 if(c->isbanned)
102 return; 102 return;
103 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 103 XUnmapWindow(dpy, c->win);
104 setclientstate(c, IconicState);
104 c->isbanned = True; 105 c->isbanned = True;
106 c->unmapped++;
105} 107}
106 108
107void 109void
@@ -135,7 +137,7 @@ detach(Client *c) {
135 137
136void 138void
137focus(Client *c) { 139focus(Client *c) {
138 if((!c && selscreen)|| (c && !isvisible(c))) 140 if((!c && selscreen) || (c && !isvisible(c)))
139 for(c = stack; c && !isvisible(c); c = c->snext); 141 for(c = stack; c && !isvisible(c); c = c->snext);
140 if(sel && sel != c) { 142 if(sel && sel != c) {
141 grabbuttons(sel, False); 143 grabbuttons(sel, False);
@@ -224,9 +226,7 @@ manage(Window w, XWindowAttributes *wa) {
224 c->isfloating = (rettrans == Success) || c->isfixed; 226 c->isfloating = (rettrans == Success) || c->isfixed;
225 attach(c); 227 attach(c);
226 attachstack(c); 228 attachstack(c);
227 ban(c); 229 c->isbanned = True;
228 XMapWindow(dpy, w);
229 setclientstate(c, NormalState);
230 focus(c); 230 focus(c);
231 lt->arrange(); 231 lt->arrange();
232} 232}
@@ -308,9 +308,10 @@ togglefloating(const char *arg) {
308 308
309void 309void
310unban(Client *c) { 310unban(Client *c) {
311 if (!c->isbanned) 311 if(!c->isbanned)
312 return; 312 return;
313 XMoveWindow(dpy, c->win, c->x, c->y); 313 XMapWindow(dpy, c->win);
314 setclientstate(c, NormalState);
314 c->isbanned = False; 315 c->isbanned = False;
315} 316}
316 317
diff --git a/config.mk b/config.mk
index f0c3489..d439502 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
1# dwm version 1# dwm version
2VERSION = 4.3 2VERSION = 4.4
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
diff --git a/dwm.h b/dwm.h
index 999f027..692c469 100644
--- a/dwm.h
+++ b/dwm.h
@@ -48,6 +48,7 @@ struct Client {
48 int rx, ry, rw, rh; /* revert geometry */ 48 int rx, ry, rw, rh; /* revert geometry */
49 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 49 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
50 int minax, maxax, minay, maxay; 50 int minax, maxax, minay, maxay;
51 int unmapped;
51 long flags; 52 long flags;
52 unsigned int border, oldborder; 53 unsigned int border, oldborder;
53 Bool isbanned, isfixed, ismax, isfloating; 54 Bool isbanned, isfixed, ismax, isfloating;
diff --git a/event.c b/event.c
index b870821..d0716fa 100644
--- a/event.c
+++ b/event.c
@@ -336,8 +336,10 @@ unmapnotify(XEvent *e) {
336 Client *c; 336 Client *c;
337 XUnmapEvent *ev = &e->xunmap; 337 XUnmapEvent *ev = &e->xunmap;
338 338
339 if((c = getclient(ev->window))) 339 if((c = getclient(ev->window)) && (ev->event == root)) {
340 unmanage(c); 340 if(ev->send_event || c->unmapped-- == 0)
341 unmanage(c);
342 }
341} 343}
342 344
343/* extern */ 345/* extern */