diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -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 | ||
| 839 | void | 840 | void |
