Adding swapfocus patch
This commit is contained in:
@ -47,12 +47,6 @@ updateholdbarpos(Monitor *m)
|
||||
{
|
||||
m->wy = m->my;
|
||||
m->wh = m->mh;
|
||||
// if (m->showbar) {
|
||||
// m->by = m->topbar ? m->wy : m->wy + m->wh - bh;
|
||||
// m->wy = m->topbar ? m->wy - bh + bh : m->wy;
|
||||
// } else {
|
||||
// m->by = -bh;
|
||||
// }
|
||||
#if EXTRABAR_PATCH
|
||||
#if BARPADDING_PATCH
|
||||
m->wh = m->wh - vertpad * m->showbar * 2 - bh * m->showbar * 2;
|
||||
|
@ -101,7 +101,10 @@
|
||||
#endif
|
||||
#if SWALLOW_PATCH
|
||||
#include "swallow.c"
|
||||
#endif // SWALLOW_PATCH
|
||||
#endif
|
||||
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
||||
#include "swapfocus.c"
|
||||
#endif
|
||||
#if SWITCHCOL_PATCH
|
||||
#include "switchcol.c"
|
||||
#endif
|
||||
|
@ -101,7 +101,10 @@
|
||||
#endif
|
||||
#if SWALLOW_PATCH
|
||||
#include "swallow.h"
|
||||
#endif // SWALLOW_PATCH
|
||||
#endif
|
||||
#if SWAPFOCUS_PATCH && PERTAG_PATCH
|
||||
#include "swapfocus.h"
|
||||
#endif
|
||||
#if SWITCHCOL_PATCH
|
||||
#include "switchcol.h"
|
||||
#endif
|
||||
@ -183,4 +186,4 @@
|
||||
#endif
|
||||
#if TILE_LAYOUT
|
||||
#include "tile.h"
|
||||
#endif
|
||||
#endif
|
@ -16,6 +16,9 @@ struct Pertag {
|
||||
#if ZOOMSWAP_PATCH
|
||||
Client *prevzooms[LENGTH(tags) + 1]; /* store zoom information */
|
||||
#endif // ZOOMSWAP_PATCH
|
||||
#if SWAPFOCUS_PATCH
|
||||
Client *prevclient[LENGTH(tags) + 1];
|
||||
#endif // SWAPFOCUS_PATCH
|
||||
};
|
||||
|
||||
void
|
||||
@ -56,6 +59,4 @@ pertagview(const Arg *arg)
|
||||
if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag])
|
||||
togglebar(NULL);
|
||||
#endif // PERTAGBAR_PATCH
|
||||
// strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); // ??
|
||||
// strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
|
||||
}
|
21
patch/swapfocus.c
Normal file
21
patch/swapfocus.c
Normal file
@ -0,0 +1,21 @@
|
||||
void
|
||||
swapfocus(const Arg *arg)
|
||||
{
|
||||
if (!selmon->sel)
|
||||
return;
|
||||
if (selmon->pertag->prevclient[selmon->pertag->curtag] != NULL
|
||||
&& ISVISIBLE(selmon->pertag->prevclient[selmon->pertag->curtag])) {
|
||||
focus(selmon->pertag->prevclient[selmon->pertag->curtag]);
|
||||
restack(selmon->pertag->prevclient[selmon->pertag->curtag]->mon);
|
||||
}
|
||||
else {
|
||||
Client *c = NULL;
|
||||
for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
|
||||
if (!c)
|
||||
for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
|
||||
if (c) {
|
||||
focus(c);
|
||||
restack(selmon);
|
||||
}
|
||||
}
|
||||
}
|
1
patch/swapfocus.h
Normal file
1
patch/swapfocus.h
Normal file
@ -0,0 +1 @@
|
||||
static void swapfocus(const Arg *arg);
|
Reference in New Issue
Block a user