Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
handling WM_STATE seems to make DnD in gtk/qt apps working, well let's handle this...
[dwm.git]
/
client.c
diff --git
a/client.c
b/client.c
index
e11abfd
..
badb875
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-53,6
+53,13
@@
grabbuttons(Client *c, Bool focused) {
GrabModeAsync, GrabModeSync, None, None);
}
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;
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);
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();
if(isvisible(c))
focus(c);
arrange();
@@
-293,6
+301,7
@@
unmanage(Client *c) {
focus(nc);
}
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
focus(nc);
}
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
+ setclientstate(c, WithdrawnState);
free(c->tags);
free(c);
XSync(dpy, False);
free(c->tags);
free(c);
XSync(dpy, False);