summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-07 12:37:06 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-07 12:37:06 +0100
commit28ffff801bb0137ec3fe4093afc4fb29784b17ec (patch)
tree2072e2465fb0b3cbf4f3241a096de99752e79be1 /client.c
parentyet another fix (diff)
downloaddwm-28ffff801bb0137ec3fe4093afc4fb29784b17ec.tar.gz
dwm-28ffff801bb0137ec3fe4093afc4fb29784b17ec.zip
replaced getproto with a saner function, now old-school artifacts of WM times in the early 90s completely disappeared, no punned pointer warning anymore ;)
Diffstat (limited to 'client.c')
-rw-r--r--client.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/client.c b/client.c
index 50e8a94..e37b9e6 100644
--- a/client.c
+++ b/client.c
@@ -120,11 +120,26 @@ getclient(Window w) {
120 return NULL; 120 return NULL;
121} 121}
122 122
123Bool
124isprotodel(Client *c) {
125 int i, n;
126 Atom *protocols;
127 Bool ret = False;
128
129 if(XGetWMProtocols(dpy, c->win, &protocols, &n)) {
130 for(i = 0; !ret && i < n; i++)
131 if(protocols[i] == wmatom[WMDelete])
132 ret = True;
133 XFree(protocols);
134 }
135 return ret;
136}
137
123void 138void
124killclient(Arg *arg) { 139killclient(Arg *arg) {
125 if(!sel) 140 if(!sel)
126 return; 141 return;
127 if(sel->proto & PROTODELWIN) 142 if(isprotodel(sel))
128 sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); 143 sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
129 else 144 else
130 XKillClient(dpy, sel->win); 145 XKillClient(dpy, sel->win);
@@ -159,7 +174,6 @@ manage(Window w, XWindowAttributes *wa) {
159 c->y = way; 174 c->y = way;
160 } 175 }
161 updatesizehints(c); 176 updatesizehints(c);
162 c->proto = getproto(c->win);
163 XSelectInput(dpy, c->win, 177 XSelectInput(dpy, c->win,
164 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); 178 StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
165 XGetTransientForHint(dpy, c->win, &trans); 179 XGetTransientForHint(dpy, c->win, &trans);