diff --git a/cmd/wm/event.c b/cmd/wm/event.c index 47d1d2a3..5363fa34 100644 --- a/cmd/wm/event.c +++ b/cmd/wm/event.c @@ -220,6 +220,8 @@ handle_enternotify(XEvent *e) if(c != old) focus(c, False); } + else if(ev->window == root) + XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); } static void diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c index 4db643f6..11fd1813 100644 --- a/cmd/wm/wm.c +++ b/cmd/wm/wm.c @@ -251,7 +251,7 @@ main(int argc, char *argv[]) other_wm_running = 0; XSetErrorHandler(startup_error_handler); /* this causes an error if some other WM is running */ - XSelectInput(dpy, root, SubstructureRedirectMask); + XSelectInput(dpy, root, SubstructureRedirectMask | EnterWindowMask); XSync(dpy, False); if(other_wm_running) {