[wiki] [sites] added killfocusnext patch, always move focus to the next visible window after killing client || Hai Nguyen

From: <git_AT_suckless.org>
Date: Sat, 11 Dec 2021 00:47:06 +0100

commit 28a9472f4e3e75da3307744696ae9cf4fc031a71
Author: Hai Nguyen <hhai2105_AT_gmail.com>
Date: Fri Dec 10 18:45:20 2021 -0500

    added killfocusnext patch, always move focus to the next visible window after killing client

diff --git a/dwm.suckless.org/patches/killfocusnext/dwm-killfocusnext-20211208-33a4918.diff b/dwm.suckless.org/patches/killfocusnext/dwm-killfocusnext-20211208-33a4918.diff
new file mode 100644
index 00000000..b5117dad
--- /dev/null
+++ b/dwm.suckless.org/patches/killfocusnext/dwm-killfocusnext-20211208-33a4918.diff
_AT_@ -0,0 +1,66 @@
+From 33a4918578a7c19ce358a0233d6731933999f105 Mon Sep 17 00:00:00 2001
+From: Hai Nguyen <hhai2105_AT_gmail.com>
+Date: Wed, 8 Dec 2021 00:30:24 -0500
+Subject: [PATCH] update focus to not change focus stack, change unmanage to
+ always move to the next visible client
+
+---
+ dwm.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/dwm.c b/dwm.c
+index 5e4d494..a2aabb4 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -793,8 +793,6 @@ focus(Client *c)
+ selmon = c->mon;
+ if (c->isurgent)
+ seturgent(c, 0);
+- detachstack(c);
+- attachstack(c);
+ grabbuttons(c, 1);
+ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
+ setfocus(c);
+_AT_@ -803,6 +801,8 @@ focus(Client *c)
+ XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
+ }
+ selmon->sel = c;
++ if(c && selmon->lt[selmon->sellt]->arrange == monocle)
++ XRaiseWindow(dpy, c->win);
+ drawbars();
+ }
+
+_AT_@ -851,8 +851,8 @@ focusstack(const Arg *arg)
+ c = i;
+ }
+ if (c) {
+- focus(c);
+ restack(selmon);
++ focus(c);
+ }
+ }
+
+_AT_@ -1767,6 +1767,9 @@ unmanage(Client *c, int destroyed)
+ {
+ Monitor *m = c->mon;
+ XWindowChanges wc;
++ int fullscreen = (selmon->sel == c && selmon->sel->isfullscreen)?1:0;
++ Client *nc;
++ for (nc = c->next; nc && !ISVISIBLE(nc); nc = nc->next);
+
+ detach(c);
+ detachstack(c);
+_AT_@ -1782,7 +1785,9 @@ unmanage(Client *c, int destroyed)
+ XUngrabServer(dpy);
+ }
+ free(c);
+- focus(NULL);
++ focus(nc);
++ if(fullscreen)
++ togglefullscreen();
+ updateclientlist();
+ arrange(m);
+ }
+--
+2.34.1
+
diff --git a/dwm.suckless.org/patches/killfocusnext/index.md b/dwm.suckless.org/patches/killfocusnext/index.md
new file mode 100644
index 00000000..04f128ea
--- /dev/null
+++ b/dwm.suckless.org/patches/killfocusnext/index.md
_AT_@ -0,0 +1,15 @@
+Kill focus next
+================
+
+Description
+-----------
+killing client will always move focus to the next visible screen on the stack. Change focus to not change the focus stack.
+
+
+Download
+--------
+* [dwm-killfocusnext-20211208-33a4918.diff](dwm-killfocusnext-20211208-33a4918.diff)
+
+Authors
+-------
+* Hai Nguyen - <hhai2105_AT_gmail.com>
Received on Sat Dec 11 2021 - 00:47:06 CET

This archive was generated by hypermail 2.3.0 : Sat Dec 11 2021 - 00:48:44 CET