Adding swaptags patch
This commit is contained in:
@ -113,6 +113,9 @@
|
||||
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
||||
#include "swapfocus.c"
|
||||
#endif
|
||||
#if SWAPTAGS_PATCH
|
||||
#include "swaptags.c"
|
||||
#endif
|
||||
#if SWITCHCOL_PATCH
|
||||
#include "switchcol.c"
|
||||
#endif
|
||||
|
@ -113,6 +113,9 @@
|
||||
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
||||
#include "swapfocus.h"
|
||||
#endif
|
||||
#if SWAPTAGS_PATCH
|
||||
#include "swaptags.h"
|
||||
#endif
|
||||
#if SWITCHCOL_PATCH
|
||||
#include "switchcol.h"
|
||||
#endif
|
||||
|
22
patch/swaptags.c
Normal file
22
patch/swaptags.c
Normal file
@ -0,0 +1,22 @@
|
||||
void
|
||||
swaptags(const Arg *arg)
|
||||
{
|
||||
unsigned int newtag = arg->ui & TAGMASK;
|
||||
unsigned int curtag = selmon->tagset[selmon->seltags];
|
||||
|
||||
if (newtag == curtag || !curtag || (curtag & (curtag-1)))
|
||||
return;
|
||||
|
||||
for (Client *c = selmon->clients; c != NULL; c = c->next) {
|
||||
if ((c->tags & newtag) || (c->tags & curtag))
|
||||
c->tags ^= curtag ^ newtag;
|
||||
|
||||
if (!c->tags)
|
||||
c->tags = newtag;
|
||||
}
|
||||
|
||||
selmon->tagset[selmon->seltags] = newtag;
|
||||
|
||||
focus(NULL);
|
||||
arrange(selmon);
|
||||
}
|
1
patch/swaptags.h
Normal file
1
patch/swaptags.h
Normal file
@ -0,0 +1 @@
|
||||
static void swaptags(const Arg *arg);
|
Reference in New Issue
Block a user