dwm

Mahdi's build of dwm
git clone git://mahdi.pw/dwm.git
Log | Files | Refs | README | LICENSE

shiftview.c (573B)


      1 /** Function to shift the current view to the left/right
      2  *
      3  * @param: "arg->i" stores the number of tags to shift right (positive value)
      4  *          or left (negative value)
      5  */
      6 void
      7 shiftview(const Arg *arg) {
      8 	Arg shifted;
      9 
     10 	if(arg->i > 0) // left circular shift
     11 		shifted.ui = (selmon->tagset[selmon->seltags] << arg->i)
     12 		   | (selmon->tagset[selmon->seltags] >> (LENGTH(tags) - arg->i));
     13 
     14 	else // right circular shift
     15 		shifted.ui = selmon->tagset[selmon->seltags] >> (- arg->i)
     16 		   | selmon->tagset[selmon->seltags] << (LENGTH(tags) + arg->i);
     17 
     18 	view(&shifted);
     19 }