Mercurial > dwm-meillo
diff client.c @ 734:6283adb1fcf2
replaced getproto with a saner function, now old-school artifacts of WM times in the early 90s completely disappeared, no punned pointer warning anymore ;)
author | Anselm R. Garbe <arg@suckless.org> |
---|---|
date | Wed, 07 Feb 2007 12:37:06 +0100 |
parents | 1950833a5614 |
children |
line wrap: on
line diff
--- a/client.c Tue Feb 06 15:29:19 2007 +0100 +++ b/client.c Wed Feb 07 12:37:06 2007 +0100 @@ -120,11 +120,26 @@ return NULL; } +Bool +isprotodel(Client *c) { + int i, n; + Atom *protocols; + Bool ret = False; + + if(XGetWMProtocols(dpy, c->win, &protocols, &n)) { + for(i = 0; !ret && i < n; i++) + if(protocols[i] == wmatom[WMDelete]) + ret = True; + XFree(protocols); + } + return ret; +} + void killclient(Arg *arg) { if(!sel) return; - if(sel->proto & PROTODELWIN) + if(isprotodel(sel)) sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); else XKillClient(dpy, sel->win); @@ -159,7 +174,6 @@ c->y = way; } updatesizehints(c); - c->proto = getproto(c->win); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans);