dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

swaptags.c (624B)


      1 void
      2 swaptags(const Arg *arg)
      3 {
      4 	Client *c;
      5 	unsigned int newtag = arg->ui & TAGMASK;
      6 	unsigned int curtag = selmon->tagset[selmon->seltags];
      7 
      8 	if (newtag == curtag || !curtag || (curtag & (curtag-1)))
      9 		return;
     10 
     11 	#if TAGSYNC_PATCH
     12 	Monitor *origselmon = selmon;
     13 	for (selmon = mons; selmon; selmon = selmon->next) {
     14 	#endif // TAGSYNC_PATCH
     15 
     16 	for (c = selmon->clients; c != NULL; c = c->next) {
     17 		if ((c->tags & newtag) || (c->tags & curtag))
     18 			c->tags ^= curtag ^ newtag;
     19 
     20 		if (!c->tags)
     21 				c->tags = newtag;
     22 	}
     23 
     24 	#if TAGSYNC_PATCH
     25 	}
     26 	selmon = origselmon;
     27 	#endif // TAGSYNC_PATCH
     28 
     29 	view(&((Arg) { .ui = newtag }));
     30 }