Source

dwm / functions.c

The default branch has multiple heads

Full commit
static void tagandview(const Arg *arg);
static void tagnextmon(const Arg *arg);
static void viewmon(const Arg *arg);

void
tagandview(const Arg *arg) {
	if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
		return;
	selmon->seltags ^= 1; /* toggle sel tagset */
	if(selmon->sel && arg->ui & TAGMASK) 
		selmon->tagset[selmon->seltags] = selmon->sel->tags = arg->ui & TAGMASK;
	arrange(selmon);
}

void 
tagnextmon(const Arg *arg) {
    Monitor *m;
    Client *c = selmon->sel;
	if(!selmon->sel || !mons->next)
		return;
    if(!(m = selmon->next))
			m = mons;
    sendmon(c, m);
	if(c && arg->ui & TAGMASK) {
		c->tags = arg->ui & TAGMASK;
		arrange(m);
    }
}

void
viewmon(const Arg *arg) {
    Monitor *m; 
    if (!mons->next)
        return;
    if(!(m = selmon->next))
        m = mons;
	m->seltags ^= 1; /* toggle sel tagset */
    if(arg->ui & TAGMASK)
        m->tagset[m->seltags] = arg->ui & TAGMASK;
    unfocus(selmon->sel);
    selmon=m;
    focus(NULL);
    arrange(m);
}
static void
tagviewnextmon(const Arg *arg) {
    Monitor *m; 
    Client *c = selmon->sel;
    if (!mons->next)
        return;
    if(!(m = selmon->next))
        m = mons;
    sendmon(c, m);
	if(c && arg->ui & TAGMASK) {
		c->tags = arg->ui & TAGMASK;
    }
	m->seltags ^= 1; /* toggle sel tagset */
    if(arg->ui & TAGMASK)
        m->tagset[m->seltags] = arg->ui & TAGMASK;
    unfocus(selmon->sel);
    selmon=m;
    focus(c);
    arrange(m);
}