JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
leavenotify also don't needs the check
[dwm.git] / event.c
diff --git a/event.c b/event.c
index a9d2fbb..0133889 100644 (file)
--- a/event.c
+++ b/event.c
@@ -234,14 +234,12 @@ enternotify(XEvent *e) {
                focus(c);
        else if(ev->window == root) {
                issel = True;
-               XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
-               drawall();
+               focus(sel);
        }
 }
 
 static void
 expose(XEvent *e) {
-       Client *c;
        XExposeEvent *ev = &e->xexpose;
 
        if(ev->count == 0) {
@@ -273,8 +271,8 @@ leavenotify(XEvent *e) {
        XCrossingEvent *ev = &e->xcrossing;
 
        if((ev->window == root) && !ev->same_screen) {
+               focus(NULL);
                issel = False;
-               drawall();
        }
 }
 
@@ -329,7 +327,8 @@ propertynotify(XEvent *e) {
                }
                if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
                        updatetitle(c);
-                       drawclient(c);
+                       if(c == sel)
+                               drawstatus();
                }
        }
 }