dwm.c
changeset 1523 26f81e0f1eb3
parent 1522 0d86faf4b05c
child 1525 c361034c5a1c
equal deleted inserted replaced
1522:0d86faf4b05c 1523:26f81e0f1eb3
   788 		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
   788 		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
   789 }
   789 }
   790 
   790 
   791 void
   791 void
   792 enternotify(XEvent *e) {
   792 enternotify(XEvent *e) {
   793 	Client *c;
       
   794 	Monitor *m;
   793 	Monitor *m;
   795 	XCrossingEvent *ev = &e->xcrossing;
   794 	XCrossingEvent *ev = &e->xcrossing;
   796 
   795 
   797 	if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
   796 	if((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root)
   798 		return;
   797 		return;
   799 	if((m = wintomon(ev->window)) && m != selmon) {
   798 	if((m = wintomon(ev->window)) && m != selmon) {
   800 		unfocus(selmon->sel, True);
   799 		unfocus(selmon->sel, True);
   801 		selmon = m;
   800 		selmon = m;
   802 	}
   801 	}
   803 	if((c = wintoclient(ev->window)))
   802 	focus(wintoclient(ev->window));
   804 		focus(c);
       
   805 	else
       
   806 		focus(NULL);
       
   807 }
   803 }
   808 
   804 
   809 void
   805 void
   810 expose(XEvent *e) {
   806 expose(XEvent *e) {
   811 	Monitor *m;
   807 	Monitor *m;