Xinqi Bao's Git

deciding for focus(NULL);
[dwm.git] / event.c
diff --git a/event.c b/event.c
index c679f9c..20ab599 100644 (file)
--- a/event.c
+++ b/event.c
@@ -235,6 +235,8 @@ enternotify(XEvent *e) {
        else if(ev->window == root) {
                issel = True;
                XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+               if(sel)
+                       focus(sel);
        }
 }
 
@@ -271,9 +273,9 @@ leavenotify(XEvent *e) {
        XCrossingEvent *ev = &e->xcrossing;
 
        if((ev->window == root) && !ev->same_screen) {
-               issel = False;
                if(sel)
-                       XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
+                       focus(NULL);
+               issel = False;
        }
 }