leavenotify also don't needs the check
[dwm.git] / event.c
diff --git a/event.c b/event.c
index c679f9c..0133889 100644 (file)
--- a/event.c
+++ b/event.c
@@ -234,7 +234,7 @@ enternotify(XEvent *e) {
                focus(c);
        else if(ev->window == root) {
                issel = True;
-               XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+               focus(sel);
        }
 }
 
@@ -271,9 +271,8 @@ leavenotify(XEvent *e) {
        XCrossingEvent *ev = &e->xcrossing;
 
        if((ev->window == root) && !ev->same_screen) {
+               focus(NULL);
                issel = False;
-               if(sel)
-                       XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
        }
 }