summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2020-01-29 08:31:00 +0100
committerbakkeby <[email protected]>2020-01-29 11:31:52 +0100
commit5e75da8dd1be76942873d6b77f6146d415c6d64c (patch)
treedf33c2415dc0ef1e9ee136954ffac145ec66e6cc /patch
parent21ba1d7bb3a15fdef1f8425f09e400f718e73b8e (diff)
downloaddwm-flexipatch-5e75da8dd1be76942873d6b77f6146d415c6d64c.tar.gz
dwm-flexipatch-5e75da8dd1be76942873d6b77f6146d415c6d64c.zip
Adding swapfocus patch
Diffstat (limited to 'patch')
-rw-r--r--patch/holdbar.c6
-rw-r--r--patch/include.c5
-rw-r--r--patch/include.h7
-rw-r--r--patch/pertag.c5
-rw-r--r--patch/swapfocus.c21
-rw-r--r--patch/swapfocus.h1
6 files changed, 34 insertions, 11 deletions
diff --git a/patch/holdbar.c b/patch/holdbar.c
index ccf662f..a06cab3 100644
--- a/patch/holdbar.c
+++ b/patch/holdbar.c
@@ -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;
diff --git a/patch/include.c b/patch/include.c
index 1fbc504..8a404e1 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -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
diff --git a/patch/include.h b/patch/include.h
index efe0917..5ef2291 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -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 \ No newline at end of file
diff --git a/patch/pertag.c b/patch/pertag.c
index 708943d..f172c65 100644
--- a/patch/pertag.c
+++ b/patch/pertag.c
@@ -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);
} \ No newline at end of file
diff --git a/patch/swapfocus.c b/patch/swapfocus.c
new file mode 100644
index 0000000..7693925
--- /dev/null
+++ b/patch/swapfocus.c
@@ -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);
+ }
+ }
+} \ No newline at end of file
diff --git a/patch/swapfocus.h b/patch/swapfocus.h
new file mode 100644
index 0000000..f573988
--- /dev/null
+++ b/patch/swapfocus.h
@@ -0,0 +1 @@
+static void swapfocus(const Arg *arg); \ No newline at end of file