// shiftview all tags regardless of tags having open windows void shiftview(const Arg *arg) { Arg view_argument; uint32_t destination_tag; // arg->i represents the direction and distance passed from config.def.h (usually -1 and +1) if(arg->i > 0){ // shift right (increase tag index), move the active tag bit to the left (0001) to (0010) destination_tag = selmon->tagset[selmon->seltags] << arg->i; }else{ // shift to the left destination_tag = selmon->tagset[selmon->seltags] >> (-arg->i); } // TAGMASK defines the valid boundary for tags (111111111) for 9 tags // if the shift pushed the active bit outside the bounds, destination_tag will become 0 if(!(destination_tag & TAGMASK)){ // If we went off to the right edge, wrap around to the first tag (000000001) // If we went off to the left, wrap around to the last tag (bit 1 shifted left by TAGCOUNT - 1) destination_tag = arg->i > 0 ? 1 : 1 << (TAGCOUNT - 1); } // pack the destination tag bitmask into the required dwl argument struct view_argument.ui = destination_tag; // pass the destination tag to dwl's view function view(&view_argument); }