commit 4a6514baebba7e05cda7de54c49d06b992864cb0
parent 3720dcf4596c36f622797c7053bc6d7a57528b86
Author: Aaron Duxler <aaron.duxler@gmail.com>
Date: Wed, 29 Jan 2020 13:29:57 +0100
[dwm][patch] swapfocus just focus next client after tag or toggletag
Diffstat:
1 file changed, 35 insertions(+), 7 deletions(-)
diff --git a/dwm.suckless.org/patches/swapfocus/dwm-swapfocus-6.2.diff b/dwm.suckless.org/patches/swapfocus/dwm-swapfocus-6.2.diff
@@ -1,6 +1,6 @@
diff -up a/config.def.h b/config.def.h
--- a/config.def.h 2020-01-29 00:06:12.415681126 +0100
-+++ b/config.def.h 2020-01-29 00:08:59.832656153 +0100
++++ b/config.def.h 2020-01-29 13:25:14.167910093 +0100
@@ -66,6 +66,7 @@ static Key keys[] = {
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
@@ -11,7 +11,7 @@ diff -up a/config.def.h b/config.def.h
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
diff -up a/dwm.c b/dwm.c
--- a/dwm.c 2020-01-29 00:06:12.419014466 +0100
-+++ b/dwm.c 2020-01-29 00:10:58.149498015 +0100
++++ b/dwm.c 2020-01-29 13:27:20.012744075 +0100
@@ -111,6 +111,7 @@ typedef struct {
void (*arrange)(Monitor *);
} Layout;
@@ -65,7 +65,7 @@ diff -up a/dwm.c b/dwm.c
}
void
-@@ -1653,11 +1664,34 @@ spawn(const Arg *arg)
+@@ -1653,11 +1664,41 @@ spawn(const Arg *arg)
}
void
@@ -93,14 +93,42 @@ diff -up a/dwm.c b/dwm.c
+void
tag(const Arg *arg)
{
++ unsigned int tagmask, tagindex;
++
if (selmon->sel && arg->ui & TAGMASK) {
selmon->sel->tags = arg->ui & TAGMASK;
focus(NULL);
++
+ selmon->pertag->prevclient[selmon->pertag->curtag] = NULL;
++ for(tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++)
++ if(tagmask & 1)
++ selmon->pertag->prevclient[tagindex] = NULL;
++
+ arrange(selmon);
+ }
+ }
+@@ -1722,7 +1763,7 @@ togglefloating(const Arg *arg)
+ void
+ toggletag(const Arg *arg)
+ {
+- unsigned int newtags;
++ unsigned int newtags, tagmask, tagindex;
+
+ if (!selmon->sel)
+ return;
+@@ -1730,6 +1771,11 @@ toggletag(const Arg *arg)
+ if (newtags) {
+ selmon->sel->tags = newtags;
+ focus(NULL);
++
++ for(tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++)
++ if(tagmask & 1)
++ selmon->pertag->prevclient[tagindex] = NULL;
++
arrange(selmon);
}
}
-@@ -1738,9 +1772,22 @@ void
+@@ -1738,9 +1784,22 @@ void
toggleview(const Arg *arg)
{
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
@@ -123,7 +151,7 @@ diff -up a/dwm.c b/dwm.c
focus(NULL);
arrange(selmon);
}
-@@ -1751,6 +1798,7 @@ unfocus(Client *c, int setfocus)
+@@ -1751,6 +1810,7 @@ unfocus(Client *c, int setfocus)
{
if (!c)
return;
@@ -131,7 +159,7 @@ diff -up a/dwm.c b/dwm.c
grabbuttons(c, 0);
XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
if (setfocus) {
-@@ -2035,12 +2083,30 @@ updatewmhints(Client *c)
+@@ -2035,12 +2095,30 @@ updatewmhints(Client *c)
void
view(const Arg *arg)
{
@@ -163,7 +191,7 @@ diff -up a/dwm.c b/dwm.c
arrange(selmon);
}
-@@ -2114,12 +2180,13 @@ void
+@@ -2114,12 +2192,13 @@ void
zoom(const Arg *arg)
{
Client *c = selmon->sel;