All pastes #2098719 Raw Edit

Someone

public c v1 · immutable
#2098719 ·published 2012-01-03 19:30 UTC
rendered paste body
focus(Client * c) {	if (c == sel) return;	Client *o;	o = sel;	if ((!c && selscreen) || (c && (c->isbastard || !isvisible(c, curmonitor()))))		for (c = stack;		    c && (c->isbastard || c->isicon || !isvisible(c, curmonitor())); c = c->snext);	if (sel && sel != c) {		XSetWindowBorder(dpy, sel->frame, style.color.norm[ColBorder]);	}	if (c) {		detachstack(c);		attachstack(c);		/* unban(c); */	}	sel = c;	if (!selscreen)		return;	if (c) {		setclientstate(c, NormalState);		if (c->isfocusable) {			XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);			givefocus(c);		}		XSetWindowBorder(dpy, sel->frame, style.color.sel[ColBorder]);		drawclient(c);	} else {		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);	}	if (o)		drawclient(o);	updateatom[ActiveWindow] (sel);	updateatom[ClientList] (NULL);	updateatom[CurDesk] (NULL);}