applied Peters wintoclient/wintomon optimisation in enternotify() 3150a8a1
garbeam@gmail.com · 2011-07-10 21:22 1 file(s) · +4 −3
dwm.c +4 −3
827 827
	if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
828 828
		return;
829 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 832
		unfocus(selmon->sel, True);
832 833
		selmon = m;
833 834
	}
834 -
	else if(c == selmon->sel || c == NULL)
835 +
	else if(!c || c == selmon->sel)
835 836
		return;
836 -
	focus((wintoclient(ev->window)));
837 +
	focus(c);
837 838
}
838 839
839 840
void