X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=e37b9e6d65b5e7a36ccf58eecdd240df6357a349;hb=9ed5de00b686ab872caab8525c6845892a1a1ac1;hp=6d88222dce62ebd7faf7df49965dcee957c8ae1d;hpb=dafbd0dcb00366e9ef36079e30d8338b199b8034;p=dwm.git diff --git a/client.c b/client.c index 6d88222..e37b9e6 100644 --- a/client.c +++ b/client.c @@ -120,11 +120,26 @@ getclient(Window w) { 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 @@ manage(Window w, XWindowAttributes *wa) { c->y = way; } updatesizehints(c); - c->proto = getproto(c->win); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans); @@ -184,7 +198,7 @@ manage(Window w, XWindowAttributes *wa) { void resize(Client *c, Bool sizehints) { - float actual, dx, dy, max, min, u; + float actual, dx, dy, max, min; XWindowChanges wc; if(c->w <= 0 || c->h <= 0)