diff options
| author | Anselm R Garbe <garbeam@gmail.com> | 2009-09-08 13:13:03 +0100 |
|---|---|---|
| committer | Anselm R Garbe <garbeam@gmail.com> | 2009-09-08 13:13:03 +0100 |
| commit | a3a859b4e93d65fd22619449d18e0437d5c2774b (patch) | |
| tree | 49d4b16e4ee439c7430f0512c3b66f300df1292d | |
| parent | always updategeom when root is configured (diff) | |
| download | dwm-a3a859b4e93d65fd22619449d18e0437d5c2774b.tar.gz dwm-a3a859b4e93d65fd22619449d18e0437d5c2774b.zip | |
added isdestroyed flag to unmanage
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 31 |
1 files changed, 16 insertions, 15 deletions
| @@ -218,7 +218,7 @@ static void togglefloating(const Arg *arg); | |||
| 218 | static void toggletag(const Arg *arg); | 218 | static void toggletag(const Arg *arg); |
| 219 | static void toggleview(const Arg *arg); | 219 | static void toggleview(const Arg *arg); |
| 220 | static void unfocus(Client *c); | 220 | static void unfocus(Client *c); |
| 221 | static void unmanage(Client *c); | 221 | static void unmanage(Client *c, Bool isdestroyed); |
| 222 | static void unmapnotify(XEvent *e); | 222 | static void unmapnotify(XEvent *e); |
| 223 | static void updategeom(void); | 223 | static void updategeom(void); |
| 224 | static void updatebarpos(Monitor *m); | 224 | static 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 | ||
| 601 | void | 601 | void |
| @@ -1626,24 +1626,25 @@ unfocus(Client *c) { | |||
| 1626 | } | 1626 | } |
| 1627 | 1627 | ||
| 1628 | void | 1628 | void |
| 1629 | unmanage(Client *c) { | 1629 | unmanage(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 | ||
| 1649 | void | 1650 | void |
| @@ -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 | ||
| 1658 | void | 1659 | void |
