X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=e5992039ac0511af6f0e09de06333daf2596f732;hb=bab5b1178dd0a6bfe08e3d658a47b3b5671a93d4;hp=3d9cd40263272c6c0a11285ac5dc9104f6227674;hpb=352cae4380713949d3800ebcda7aff3bb5ab9efc;p=dwm.git diff --git a/client.c b/client.c index 3d9cd40..e599203 100644 --- a/client.c +++ b/client.c @@ -153,11 +153,20 @@ focus(Client *c) { } void -killclient(Arg arg) { +killclient(const char *arg) { + XEvent ev; + if(!sel) return; - if(isprotodel(sel)) - sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); + if(isprotodel(sel)) { + ev.type = ClientMessage; + ev.xclient.window = sel->win; + ev.xclient.message_type = wmatom[WMProtocols]; + ev.xclient.format = 32; + ev.xclient.data.l[0] = wmatom[WMDelete]; + ev.xclient.data.l[1] = CurrentTime; + XSendEvent(dpy, sel->win, False, NoEventMask, &ev); + } else XKillClient(dpy, sel->win); } @@ -203,8 +212,8 @@ manage(Window w, XWindowAttributes *wa) { updatetitle(c); for(t = clients; t && t->win != trans; t = t->next); settags(c, t); - if(!c->isversatile) - c->isversatile = (t != NULL) || c->isfixed; + if(!c->isfloating) + c->isfloating = (t != NULL) || c->isfixed; attach(c); attachstack(c); c->isbanned = True; @@ -285,10 +294,10 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { } void -toggleversatile(Arg arg) { - if(!sel || lt->arrange == versatile) +togglefloating(const char *arg) { + if(!sel || lt->arrange == floating) return; - sel->isversatile = !sel->isversatile; + sel->isfloating = !sel->isfloating; lt->arrange(); }