about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorgarbeam@gmail.com <unknown>2011-06-25 09:07:28 +0100
committergarbeam@gmail.com <unknown>2011-06-25 09:07:28 +0100
commit3a392b855882786d1aa9c842d1c36b5c1cbc576a (patch)
tree03650d2f289f1caf5388211a5163a879c574c3d2
parent92fe06b501a5458a6aecdcc53f8d35c2a1f55c1c (diff)
downloaddwm-3a392b855882786d1aa9c842d1c36b5c1cbc576a.tar.gz
making enternotify less focus hungry
-rw-r--r--BUGS21
-rw-r--r--dwm.c4
2 files changed, 4 insertions, 21 deletions
diff --git a/BUGS b/BUGS
index 267527d..fd1837f 100644
--- a/BUGS
+++ b/BUGS
@@ -8,27 +8,6 @@ reproducible with xrandr -s but not with --output and --mode, strange
 
 ---
 
-> enternotify is handled even when the entered window is already focused
-> (eg moving the mouse to the bar and back, scrolling on the border..)
->
-> focusing might be expensive for some clients (eg dim/light up)
->
-> a possible solution is to modify enternotify:
->
-> +       c = wintoclient(ev->window);
->        if((m = wintomon(ev->window)) && m != selmon) {
->                unfocus(selmon->sel);
->                selmon = m;
->        }
-> +       else if (c == selmon->sel || c == NULL)
-> +               return;
-
----
-
-dmenu appears on the monitor where the pointer is and not on selmon
-
----
-
 yet another corner case:
 open a terminal, focus another monitor, but without moving the mouse
 pointer there
diff --git a/dwm.c b/dwm.c
index 84c0ae6..8c1adeb 100644
--- a/dwm.c
+++ b/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)));
 }