summaryrefslogtreecommitdiffstats
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
parentregarding to http://plan9.bell-labs.com/sources/contrib/rsc/man.ps the BUGS s... (diff)
downloaddwm-a5cb80b86cdedb8cd1f3a02de47f204bd174f649.tar.gz
dwm-a5cb80b86cdedb8cd1f3a02de47f204bd174f649.zip
handling WM_STATE seems to make DnD in gtk/qt apps working, well let's handle this in dwm as well
Diffstat (limited to '')
-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);