X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/f8181f64e2ba4fca4e85036c48cf90a2151794fc..201c56f6d36e7f895c465f534fdb90e3d9e4ca18:/event.c diff --git a/event.c b/event.c index a809511..0133889 100644 --- a/event.c +++ b/event.c @@ -234,13 +234,12 @@ enternotify(XEvent *e) { focus(c); else if(ev->window == root) { issel = True; - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); + focus(sel); } } static void expose(XEvent *e) { - Client *c; XExposeEvent *ev = &e->xexpose; if(ev->count == 0) { @@ -271,8 +270,10 @@ static void leavenotify(XEvent *e) { XCrossingEvent *ev = &e->xcrossing; - if((ev->window == root) && !ev->same_screen) + if((ev->window == root) && !ev->same_screen) { + focus(NULL); issel = False; + } } static void