# HG changeset patch # User Anselm R. Garbe # Date 1185635925 -7200 # Node ID 60d5a92ce85c30123554aeebd8120fc4391c0e74 # Parent 6f9cf0cfe2785231b4e95d4589bee164cf3dbf38 changed ban/unban implementation to not move the windows anymore, but map/unmap them instead - PLEASE TEST THIS diff -r 6f9cf0cfe278 -r 60d5a92ce85c client.c --- a/client.c Sat Jul 28 12:58:56 2007 +0200 +++ b/client.c Sat Jul 28 17:18:45 2007 +0200 @@ -98,10 +98,12 @@ 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 @@ 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 @@ 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 @@ 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 -r 6f9cf0cfe278 -r 60d5a92ce85c config.mk --- a/config.mk Sat Jul 28 12:58:56 2007 +0200 +++ b/config.mk Sat Jul 28 17:18:45 2007 +0200 @@ -1,5 +1,5 @@ # dwm version -VERSION = 4.3 +VERSION = 4.4 # Customize below to fit your system diff -r 6f9cf0cfe278 -r 60d5a92ce85c dwm.h --- a/dwm.h Sat Jul 28 12:58:56 2007 +0200 +++ b/dwm.h Sat Jul 28 17:18:45 2007 +0200 @@ -48,6 +48,7 @@ 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 -r 6f9cf0cfe278 -r 60d5a92ce85c event.c --- a/event.c Sat Jul 28 12:58:56 2007 +0200 +++ b/event.c Sat Jul 28 17:18:45 2007 +0200 @@ -336,8 +336,10 @@ 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 */