about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-28 20:29:41 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-28 20:29:41 +0100
commita5cb80b86cdedb8cd1f3a02de47f204bd174f649 (patch)
tree95ae3939b6ab82281ea076c34ffff73c662eacf5 /client.c
parent7e98db251e383674440d75dc42d98ab6eed79ac7 (diff)
downloaddwm-a5cb80b86cdedb8cd1f3a02de47f204bd174f649.tar.gz
handling WM_STATE seems to make DnD in gtk/qt apps working, well let's handle this in dwm as well
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) {
 				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;
@@ -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);