[wiki] [sites] [dwm][patch][focusmaster] Added 6.2 version for focusmaster-return || Jack Bird

From: <git_AT_suckless.org>
Date: Fri, 27 Aug 2021 02:29:07 +0200

commit 82394ec8863ce4a2f049b72088251418ce9bd38b
Author: Jack Bird <jack.bird_AT_durham.ac.uk>
Date: Fri Aug 27 01:28:31 2021 +0100

    [dwm][patch][focusmaster] Added 6.2 version for focusmaster-return

diff --git a/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-return-6.2.diff b/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-return-6.2.diff
new file mode 100644
index 00000000..975af081
--- /dev/null
+++ b/dwm.suckless.org/patches/focusmaster/dwm-focusmaster-return-6.2.diff
_AT_@ -0,0 +1,90 @@
+From 8f662e7a556f94bda83ec724fb036e15b2badaac Mon Sep 17 00:00:00 2001
+From: Jack Bird <jack.bird_AT_durham.ac.uk>
+Date: Fri, 27 Aug 2021 01:14:44 +0100
+Subject: [PATCH] 6.2 focusmaster return
+
+---
+ dwm.c | 39 +++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 39 insertions(+)
+
+diff --git a/dwm.c b/dwm.c
+index 4465af1..5219cbd 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -127,6 +127,7 @@ struct Monitor {
+ Client *clients;
+ Client *sel;
+ Client *stack;
++ Client *tagmarked[32];
+ Monitor *next;
+ Window barwin;
+ const Layout *lt[2];
+_AT_@ -167,6 +168,7 @@ static void enternotify(XEvent *e);
+ static void expose(XEvent *e);
+ static void focus(Client *c);
+ static void focusin(XEvent *e);
++static void focusmaster(const Arg *arg);
+ static void focusmon(const Arg *arg);
+ static void focusstack(const Arg *arg);
+ static int getrootptr(int *x, int *y);
+_AT_@ -659,6 +661,10 @@ detach(Client *c)
+ {
+ Client **tc;
+
++ for (int i = 1; i < LENGTH(tags); i++)
++ if (c == c->mon->tagmarked[i])
++ c->mon->tagmarked[i] = NULL;
++
+ for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next);
+ *tc = c->next;
+ }
+_AT_@ -815,6 +821,34 @@ focusin(XEvent *e)
+ setfocus(selmon->sel);
+ }
+
++void
++focusmaster(const Arg *arg)
++{
++ Client *master;
++
++ if (selmon->nmaster > 1)
++ return;
++ if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
++ return;
++
++ master = nexttiled(selmon->clients);
++
++ if (!master)
++ return;
++
++ int i;
++ for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
++ i++;
++
++ if (selmon->sel == master) {
++ if (selmon->tagmarked[i] && ISVISIBLE(selmon->tagmarked[i]))
++ focus(selmon->tagmarked[i]);
++ } else {
++ selmon->tagmarked[i] = selmon->sel;
++ focus(master);
++ }
++}
++
+ void
+ focusmon(const Arg *arg)
+ {
+_AT_@ -1202,6 +1236,11 @@ nexttiled(Client *c)
+ void
+ pop(Client *c)
+ {
++ int i;
++ for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++);
++ i++;
++
++ c->mon->tagmarked[i] = nexttiled(c->mon->clients);
+ detach(c);
+ attach(c);
+ focus(c);
+--
+2.33.0
+
diff --git a/dwm.suckless.org/patches/focusmaster/index.md b/dwm.suckless.org/patches/focusmaster/index.md
index 866128b6..523fd118 100644
--- a/dwm.suckless.org/patches/focusmaster/index.md
+++ b/dwm.suckless.org/patches/focusmaster/index.md
_AT_@ -20,6 +20,9 @@ Download
 --------
 * [dwm-focusmaster-20200717-bb2e722.diff](dwm-focusmaster-20200717-bb2e722.diff) (2020.07.17)
 * [dwm-focusmaster-20210804-138b405.diff](dwm-focusmaster-20210804-138b405.diff) (2021.08.04)
+
+
+* [dwm-focusmaster-return-6.2.diff](dwm-focusmaster-return-6.2.diff) (2021.08.27)
 * [dwm-focusmaster-return-20210804-138b405.diff](dwm-focusmaster-return-20210804-138b405.diff) (2021.08.04)
 
 Author
Received on Fri Aug 27 2021 - 02:29:07 CEST

This archive was generated by hypermail 2.3.0 : Fri Aug 27 2021 - 02:36:46 CEST