JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fixed XSync handling and finished man page
[dwm.git] / client.c
index 1e3216e..158b928 100644 (file)
--- a/client.c
+++ b/client.c
@@ -49,13 +49,12 @@ focus(Client *c)
        Client *old = sel;
        XEvent ev;
 
-       XFlush(dpy);
        sel = c;
        if(old && old != c)
                drawtitle(old);
        drawtitle(c);
        XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
-       XFlush(dpy);
+       XSync(dpy, False);
        while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
 
@@ -178,7 +177,7 @@ killclient(Arg *arg)
        if(!sel)
                return;
        if(sel->proto & WM_PROTOCOL_DELWIN)
-               sendevent(sel->win, wm_atom[WMProtocols], wm_atom[WMDelete]);
+               sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
        else
                XKillClient(dpy, sel->win);
 }
@@ -303,7 +302,7 @@ resize(Client *c, Bool inc)
        e.above = None;
        e.override_redirect = False;
        XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&e);
-       XFlush(dpy);
+       XSync(dpy, False);
 }
 
 void
@@ -353,7 +352,7 @@ settitle(Client *c)
 
        name.nitems = 0;
        c->name[0] = 0;
-       XGetTextProperty(dpy, c->win, &name, net_atom[NetWMName]);
+       XGetTextProperty(dpy, c->win, &name, netatom[NetWMName]);
        if(!name.nitems)
                XGetWMName(dpy, c->win, &name);
        if(!name.nitems)
@@ -393,7 +392,7 @@ unmanage(Client *c)
 
        free(c);
 
-       XFlush(dpy);
+       XSync(dpy, False);
        XSetErrorHandler(xerror);
        XUngrabServer(dpy);
        arrange(NULL);