summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/client.c b/client.c
index e11abfd..badb875 100644
--- a/client.c
+++ b/client.c
@@ -53,6 +53,13 @@ grabbuttons(Client *c, Bool focused) {
53 GrabModeAsync, GrabModeSync, None, None); 53 GrabModeAsync, GrabModeSync, None, None);
54} 54}
55 55
56static void
57setclientstate(Client *c, long state) {
58 long data[] = {state, None};
59 XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32,
60 PropModeReplace, (unsigned char *)data, 2);
61}
62
56static int 63static int
57xerrordummy(Display *dsply, XErrorEvent *ee) { 64xerrordummy(Display *dsply, XErrorEvent *ee) {
58 return 0; 65 return 0;
@@ -169,6 +176,7 @@ manage(Window w, XWindowAttributes *wa) {
169 stack = clients = c; 176 stack = clients = c;
170 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 177 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
171 XMapWindow(dpy, c->win); 178 XMapWindow(dpy, c->win);
179 setclientstate(c, NormalState);
172 if(isvisible(c)) 180 if(isvisible(c))
173 focus(c); 181 focus(c);
174 arrange(); 182 arrange();
@@ -293,6 +301,7 @@ unmanage(Client *c) {
293 focus(nc); 301 focus(nc);
294 } 302 }
295 XUngrabButton(dpy, AnyButton, AnyModifier, c->win); 303 XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
304 setclientstate(c, WithdrawnState);
296 free(c->tags); 305 free(c->tags);
297 free(c); 306 free(c);
298 XSync(dpy, False); 307 XSync(dpy, False);