X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=f3c9bf20254a2e29307a7deda915d95602a8c53a;hb=7ece30ebc04640258b5e20dcc71f51e1b01c9222;hp=e11abfda43d767aca153b5466e19bf43a61a2565;hpb=2c1db7ed354f303c2a2aa7eb6b7de3a0dac5d022;p=dwm.git diff --git a/client.c b/client.c index e11abfd..f3c9bf2 100644 --- a/client.c +++ b/client.c @@ -7,7 +7,7 @@ #include #include -/* static functions */ +/* static */ static void detachstack(Client *c) { @@ -53,12 +53,19 @@ grabbuttons(Client *c, Bool focused) { GrabModeAsync, GrabModeSync, None, None); } +static void +setclientstate(Client *c, long state) { + long data[] = {state, None}; + XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, + PropModeReplace, (unsigned char *)data, 2); +} + static int xerrordummy(Display *dsply, XErrorEvent *ee) { return 0; } -/* extern functions */ +/* extern */ void configure(Client *c) { @@ -169,6 +176,7 @@ manage(Window w, XWindowAttributes *wa) { stack = clients = c; XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); XMapWindow(dpy, c->win); + setclientstate(c, NormalState); if(isvisible(c)) focus(c); arrange(); @@ -293,6 +301,7 @@ unmanage(Client *c) { focus(nc); } XUngrabButton(dpy, AnyButton, AnyModifier, c->win); + setclientstate(c, WithdrawnState); free(c->tags); free(c); XSync(dpy, False);