Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
making enternotify less focus hungry
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
84c0ae6
..
8c1adeb
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-820,15
+820,19
@@
drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
void
enternotify(XEvent *e) {
void
enternotify(XEvent *e) {
+ Client *c;
Monitor *m;
XCrossingEvent *ev = &e->xcrossing;
if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
return;
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;
}
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)));
}
focus((wintoclient(ev->window)));
}