tadded isdestroyed flag to unmanage - dwm - [fork] customized build of dwm, the… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit a3a859b4e93d65fd22619449d18e0437d5c2774b | |
parent 9c066c24b3d0b7767651f0f403db2e4007a847c8 | |
Author: Anselm R Garbe <[email protected]> | |
Date: Tue, 8 Sep 2009 13:13:03 +0100 | |
added isdestroyed flag to unmanage | |
Diffstat: | |
M dwm.c | 31 ++++++++++++++++-------------… | |
1 file changed, 16 insertions(+), 15 deletions(-) | |
--- | |
diff --git a/dwm.c b/dwm.c | |
t@@ -218,7 +218,7 @@ static void togglefloating(const Arg *arg); | |
static void toggletag(const Arg *arg); | |
static void toggleview(const Arg *arg); | |
static void unfocus(Client *c); | |
-static void unmanage(Client *c); | |
+static void unmanage(Client *c, Bool isdestroyed); | |
static void unmapnotify(XEvent *e); | |
static void updategeom(void); | |
static void updatebarpos(Monitor *m); | |
t@@ -466,7 +466,7 @@ cleanup(void) { | |
selmon->lt[selmon->sellt] = &foo; | |
for(m = mons; m; m = m->next) | |
while(m->stack) | |
- unmanage(m->stack); | |
+ unmanage(m->stack, False); | |
if(dc.font.set) | |
XFreeFontSet(dpy, dc.font.set); | |
else | |
t@@ -595,7 +595,7 @@ destroynotify(XEvent *e) { | |
XDestroyWindowEvent *ev = &e->xdestroywindow; | |
if((c = wintoclient(ev->window))) | |
- unmanage(c); | |
+ unmanage(c, True); | |
} | |
void | |
t@@ -1626,24 +1626,25 @@ unfocus(Client *c) { | |
} | |
void | |
-unmanage(Client *c) { | |
+unmanage(Client *c, Bool isdestroyed) { | |
XWindowChanges wc; | |
- wc.border_width = c->oldbw; | |
/* The server grab construct avoids race conditions. */ | |
- XGrabServer(dpy); | |
- XSetErrorHandler(xerrordummy); | |
- XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ | |
detach(c); | |
detachstack(c); | |
- XUngrabButton(dpy, AnyButton, AnyModifier, c->win); | |
- setclientstate(c, WithdrawnState); | |
+ if(!isdestroyed) { | |
+ wc.border_width = c->oldbw; | |
+ XGrabServer(dpy); | |
+ XSetErrorHandler(xerrordummy); | |
+ XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore … | |
+ XUngrabButton(dpy, AnyButton, AnyModifier, c->win); | |
+ setclientstate(c, WithdrawnState); | |
+ XSync(dpy, False); | |
+ XSetErrorHandler(xerror); | |
+ XUngrabServer(dpy); | |
+ } | |
free(c); | |
- XSync(dpy, False); | |
- XSetErrorHandler(xerror); | |
- XUngrabServer(dpy); | |
focus(NULL); | |
- arrange(); | |
} | |
void | |
t@@ -1652,7 +1653,7 @@ unmapnotify(XEvent *e) { | |
XUnmapEvent *ev = &e->xunmap; | |
if((c = wintoclient(ev->window))) | |
- unmanage(c); | |
+ unmanage(c, False); | |
} | |
void |