summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index a0ab126..01e8d1f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -827,13 +827,14 @@ enternotify(XEvent *e) {
827 if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) 827 if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
828 return; 828 return;
829 c = wintoclient(ev->window); 829 c = wintoclient(ev->window);
830 if((m = wintomon(ev->window)) && m != selmon) { 830 m = c ? c->mon : wintomon(ev->window);
831 if(m != selmon) {
831 unfocus(selmon->sel, True); 832 unfocus(selmon->sel, True);
832 selmon = m; 833 selmon = m;
833 } 834 }
834 else if(c == selmon->sel || c == NULL) 835 else if(!c || c == selmon->sel)
835 return; 836 return;
836 focus((wintoclient(ev->window))); 837 focus(c);
837} 838}
838 839
839void 840void