commit 28a9472f4e3e75da3307744696ae9cf4fc031a71
Author: Hai Nguyen <[email protected]>
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
@@ -0,0 +1,66 @@
+From 33a4918578a7c19ce358a0233d6731933999f105 Mon Sep 17 00:00:00 2001
+From: Hai Nguyen <[email protected]>
+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
+@@ -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);
+@@ -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();
+ }
+ 
+@@ -851,8 +851,8 @@ focusstack(const Arg *arg)
+                                       c = i;
+       }
+       if (c) {
+-              focus(c);
+               restack(selmon);
++              focus(c);
+       }
+ }
+ 
+@@ -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);
+@@ -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
@@ -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 - <[email protected]>


Reply via email to