making enternotify less focus hungry

This commit is contained in:
garbeam@gmail.com
2011-06-25 09:07:28 +01:00
parent 92fe06b501
commit 3a392b8558
2 changed files with 4 additions and 21 deletions

4
dwm.c

@ -820,15 +820,19 @@ drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
void
enternotify(XEvent *e) {
Client *c;
Monitor *m;
XCrossingEvent *ev = &e->xcrossing;
if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
return;
c = wintoclient(ev->window);
if((m = wintomon(ev->window)) && m != selmon) {
unfocus(selmon->sel, True);
selmon = m;
}
else if(c == selmon->sel || c == NULL)
return;
focus((wintoclient(ev->window)));
}