JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removed sendevent
[dwm.git] / client.c
index 4ba15c4..e599203 100644 (file)
--- a/client.c
+++ b/client.c
@@ -154,10 +154,19 @@ focus(Client *c) {
 
 void
 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->isuntiled)
-               c->isuntiled = (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
-toggletiled(const char *arg) {
-       if(!sel || lt->arrange == untile)
+togglefloating(const char *arg) {
+       if(!sel || lt->arrange == floating)
                return;
-       sel->isuntiled = !sel->isuntiled;
+       sel->isfloating = !sel->isfloating;
        lt->arrange();
 }