about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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) {
 
 void
 ban(Client *c) {
-	if (c->isbanned)
+	if(c->isbanned)
 		return;
-	XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+	XUnmapWindow(dpy, c->win);
+	setclientstate(c, IconicState);
 	c->isbanned = True;
+	c->unmapped++;
 }
 
 void
@@ -135,7 +137,7 @@ detach(Client *c) {
 
 void
 focus(Client *c) {
-	if((!c && selscreen)|| (c && !isvisible(c)))
+	if((!c && selscreen) || (c && !isvisible(c)))
 		for(c = stack; c && !isvisible(c); c = c->snext);
 	if(sel && sel != c) {
 		grabbuttons(sel, False);
@@ -224,9 +226,7 @@ manage(Window w, XWindowAttributes *wa) {
 		c->isfloating = (rettrans == Success) || c->isfixed;
 	attach(c);
 	attachstack(c);
-	ban(c);
-	XMapWindow(dpy, w);
-	setclientstate(c, NormalState);
+	c->isbanned = True;
 	focus(c);
 	lt->arrange();
 }
@@ -308,9 +308,10 @@ togglefloating(const char *arg) {
 
 void
 unban(Client *c) {
-	if (!c->isbanned)
+	if(!c->isbanned)
 		return;
-	XMoveWindow(dpy, c->win, c->x, c->y);
+	XMapWindow(dpy, c->win);
+	setclientstate(c, NormalState);
 	c->isbanned = False;
 }
 
diff --git a/config.mk b/config.mk
index f0c3489..d439502 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
 # dwm version
-VERSION = 4.3
+VERSION = 4.4
 
 # Customize below to fit your system
 
diff --git a/dwm.h b/dwm.h
index 999f027..692c469 100644
--- a/dwm.h
+++ b/dwm.h
@@ -48,6 +48,7 @@ struct Client {
 	int rx, ry, rw, rh; /* revert geometry */
 	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
 	int minax, maxax, minay, maxay;
+	int unmapped;
 	long flags; 
 	unsigned int border, oldborder;
 	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) {
 	Client *c;
 	XUnmapEvent *ev = &e->xunmap;
 
-	if((c = getclient(ev->window)))
-		unmanage(c);
+	if((c = getclient(ev->window)) && (ev->event == root)) {
+		if(ev->send_event || c->unmapped-- == 0)
+			unmanage(c);
+	}
 }
 
 /* extern */
262'>262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307