summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2009-09-08 13:13:03 +0100
committerAnselm R Garbe <garbeam@gmail.com>2009-09-08 13:13:03 +0100
commita3a859b4e93d65fd22619449d18e0437d5c2774b (patch)
tree49d4b16e4ee439c7430f0512c3b66f300df1292d
parentalways updategeom when root is configured (diff)
downloaddwm-a3a859b4e93d65fd22619449d18e0437d5c2774b.tar.gz
dwm-a3a859b4e93d65fd22619449d18e0437d5c2774b.zip
added isdestroyed flag to unmanage
Diffstat (limited to '')
-rw-r--r--dwm.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/dwm.c b/dwm.c
index 7a4600f..a2c1e00 100644
--- a/dwm.c
+++ b/dwm.c
@@ -218,7 +218,7 @@ static void togglefloating(const Arg *arg);
218static void toggletag(const Arg *arg); 218static void toggletag(const Arg *arg);
219static void toggleview(const Arg *arg); 219static void toggleview(const Arg *arg);
220static void unfocus(Client *c); 220static void unfocus(Client *c);
221static void unmanage(Client *c); 221static void unmanage(Client *c, Bool isdestroyed);
222static void unmapnotify(XEvent *e); 222static void unmapnotify(XEvent *e);
223static void updategeom(void); 223static void updategeom(void);
224static void updatebarpos(Monitor *m); 224static void updatebarpos(Monitor *m);
@@ -466,7 +466,7 @@ cleanup(void) {
466 selmon->lt[selmon->sellt] = &foo; 466 selmon->lt[selmon->sellt] = &foo;
467 for(m = mons; m; m = m->next) 467 for(m = mons; m; m = m->next)
468 while(m->stack) 468 while(m->stack)
469 unmanage(m->stack); 469 unmanage(m->stack, False);
470 if(dc.font.set) 470 if(dc.font.set)
471 XFreeFontSet(dpy, dc.font.set); 471 XFreeFontSet(dpy, dc.font.set);
472 else 472 else
@@ -595,7 +595,7 @@ destroynotify(XEvent *e) {
595 XDestroyWindowEvent *ev = &e->xdestroywindow; 595 XDestroyWindowEvent *ev = &e->xdestroywindow;
596 596
597 if((c = wintoclient(ev->window))) 597 if((c = wintoclient(ev->window)))
598 unmanage(c); 598 unmanage(c, True);
599} 599}
600 600
601void 601void
@@ -1626,24 +1626,25 @@ unfocus(Client *c) {
1626} 1626}
1627 1627
1628void 1628void
1629unmanage(Client *c) { 1629unmanage(Client *c, Bool isdestroyed) {
1630 XWindowChanges wc; 1630 XWindowChanges wc;
1631 1631
1632 wc.border_width = c->oldbw;
1633 /* The server grab construct avoids race conditions. */ 1632 /* The server grab construct avoids race conditions. */
1634 XGrabServer(dpy);
1635 XSetErrorHandler(xerrordummy);
1636 XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
1637 detach(c); 1633 detach(c);
1638 detachstack(c); 1634 detachstack(c);
1639 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 1635 if(!isdestroyed) {
1640 setclientstate(c, WithdrawnState); 1636 wc.border_width = c->oldbw;
1637 XGrabServer(dpy);
1638 XSetErrorHandler(xerrordummy);
1639 XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
1640 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
1641 setclientstate(c, WithdrawnState);
1642 XSync(dpy, False);
1643 XSetErrorHandler(xerror);
1644 XUngrabServer(dpy);
1645 }
1641 free(c); 1646 free(c);
1642 XSync(dpy, False);
1643 XSetErrorHandler(xerror);
1644 XUngrabServer(dpy);
1645 focus(NULL); 1647 focus(NULL);
1646 arrange();
1647} 1648}
1648 1649
1649void 1650void
@@ -1652,7 +1653,7 @@ unmapnotify(XEvent *e) {
1652 XUnmapEvent *ev = &e->xunmap; 1653 XUnmapEvent *ev = &e->xunmap;
1653 1654
1654 if((c = wintoclient(ev->window))) 1655 if((c = wintoclient(ev->window)))
1655 unmanage(c); 1656 unmanage(c, False);
1656} 1657}
1657 1658
1658void 1659void