shift-tools.c
void
shifttagclients(const Arg *arg)
{

	Arg shifted;
	Client *c;
	unsigned int tagmask = 0;
	shifted.ui = selmon->tagset[selmon->seltags];

	for (c = selmon->clients; c; c = c->next)
		if (!(c->tags))
			tagmask = tagmask | c->tags;


	if (arg->i > 0)	/* left circular shift */
		do {
			shifted.ui = (shifted.ui << arg->i)
			   | (shifted.ui >> (LENGTH(tags) - arg->i));
		} while (tagmask && !(shifted.ui & tagmask));
	else		/* right circular shift */
		do {
			shifted.ui = (shifted.ui >> (- arg->i)
			   | shifted.ui << (LENGTH(tags) + arg->i));
		} while (tagmask && !(shifted.ui & tagmask));
	tag(&shifted);
}
/* Sends a window to the next/prev tag that has a client, else it moves it to the next/prev one. */
Sends a window to the next/prev tag that has a client, else it moves it to the next/prev one.
Sends a window to the next / prev tag that has a client else it moves it to the next / prev one .
void
shifttagclients(const Arg *arg)
{
	Arg shifted;
	Client *c;
	unsigned int tagmask = 0;
	shifted.ui = selmon->tagset[selmon->seltags];
	for (c = selmon->clients; c; c = c->next)
		if (!(c->tags))
			tagmask = tagmask | c->tags;
	if (arg->i > 0)	
		do {
			shifted.ui = (shifted.ui << arg->i)
			   | (shifted.ui >> (LENGTH(tags) - arg->i));
		} while (tagmask && !(shifted.ui & tagmask));
	else		
		do {
			shifted.ui = (shifted.ui >> (- arg->i)
			   | shifted.ui << (LENGTH(tags) + arg->i));
		} while (tagmask && !(shifted.ui & tagmask));
	tag(&shifted);
}
void shifttagclients ( const Arg * arg ) { Arg shifted ; Client * c ; unsigned int tagmask = 0 ; shifted . ui = selmon -> tagset [ selmon -> seltags ] ; for ( c = selmon -> clients ; c ; c = c -> next ) if ( ! ( c -> tags ) ) tagmask = tagmask | c -> tags ; if ( arg -> i > 0 ) do { shifted . ui = ( shifted . ui << arg -> i ) | ( shifted . ui >> ( LENGTH ( tags ) - arg -> i ) ) ; } while ( tagmask && ! ( shifted . ui & tagmask ) ) ; else do { shifted . ui = ( shifted . ui >> ( - arg -> i ) | shifted . ui << ( LENGTH ( tags ) + arg -> i ) ) ; } while ( tagmask && ! ( shifted . ui & tagmask ) ) ; tag ( & shifted ) ; }
Sends a window to the next/prev tag that has a client, else it moves it to the next/prev one.
Sends a window to the next / prev tag that has a client else it moves it to the next / prev one .
/* left circular shift */ /* right circular shift */