[wiki] [sites] Update movestack patch for latest dwm || Charles Lehner

From: <git_AT_suckless.org>
Date: Sat, 04 Jun 2016 18:47:55 +0200

commit 6a5ffffc19e36acc7bd50d5e70647c1ebe76f679
Author: Charles Lehner <cel_AT_celehner.com>
Date: Sat Jun 4 12:40:13 2016 -0400

    Update movestack patch for latest dwm
    
    Move old patch to historical

diff --git a/dwm.suckless.org/patches/historical/dwm-5.8.2-movestack.diff b/dwm.suckless.org/patches/historical/dwm-5.8.2-movestack.diff
new file mode 100644
index 0000000..72f7b6b
--- /dev/null
+++ b/dwm.suckless.org/patches/historical/dwm-5.8.2-movestack.diff
_AT_@ -0,0 +1,73 @@
+diff -r 050d521d66d8 config.def.h
+--- a/config.def.h Tue Aug 24 13:13:20 2010 +0100
++++ b/config.def.h Sun Sep 05 18:43:07 2010 +0200
+_AT_@ -48,6 +48,7 @@
+ static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+ static const char *termcmd[] = { "uxterm", NULL };
+
++#include "movestack.c"
+ static Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
+_AT_@ -57,6 +58,8 @@
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
++ { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
++ { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+diff -r 050d521d66d8 movestack.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/movestack.c Sun Sep 05 18:43:07 2010 +0200
+_AT_@ -0,0 +1,49 @@
++void
++movestack(const Arg *arg) {
++ Client *c = NULL, *p = NULL, *pc = NULL, *i;
++
++ if(arg->i > 0) {
++ /* find the client after selmon->sel */
++ for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
++ if(!c)
++ for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
++
++ }
++ else {
++ /* find the client before selmon->sel */
++ for(i = selmon->clients; i != selmon->sel; i = i->next)
++ if(ISVISIBLE(i) && !i->isfloating)
++ c = i;
++ if(!c)
++ for(; i; i = i->next)
++ if(ISVISIBLE(i) && !i->isfloating)
++ c = i;
++ }
++ /* find the client before selmon->sel and c */
++ for(i = selmon->clients; i && (!p || !pc); i = i->next) {
++ if(i->next == selmon->sel)
++ p = i;
++ if(i->next == c)
++ pc = i;
++ }
++
++ /* swap c and selmon->sel selmon->clients in the selmon->clients list */
++ if(c && c != selmon->sel) {
++ Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
++ selmon->sel->next = c->next==selmon->sel?c:c->next;
++ c->next = temp;
++
++ if(p && p != c)
++ p->next = c;
++ if(pc && pc != selmon->sel)
++ pc->next = selmon->sel;
++
++ if(selmon->sel == selmon->clients)
++ selmon->clients = c;
++ else if(c == selmon->clients)
++ selmon->clients = selmon->sel;
++
++ arrange(selmon);
++ }
++}
++
diff --git a/dwm.suckless.org/patches/movestack-5.8.2.diff b/dwm.suckless.org/patches/movestack-5.8.2.diff
deleted file mode 100644
index 72f7b6b..0000000
--- a/dwm.suckless.org/patches/movestack-5.8.2.diff
+++ /dev/null
_AT_@ -1,73 +0,0 @@
-diff -r 050d521d66d8 config.def.h
---- a/config.def.h Tue Aug 24 13:13:20 2010 +0100
-+++ b/config.def.h Sun Sep 05 18:43:07 2010 +0200
-_AT_@ -48,6 +48,7 @@
- static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
- static const char *termcmd[] = { "uxterm", NULL };
-
-+#include "movestack.c"
- static Key keys[] = {
- /* modifier key function argument */
- { MODKEY, XK_p, spawn, {.v = dmenucmd } },
-_AT_@ -57,6 +58,8 @@
- { MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_h, setmfact, {.f = -0.05} },
- { MODKEY, XK_l, setmfact, {.f = +0.05} },
-+ { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
-+ { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
- { MODKEY, XK_Return, zoom, {0} },
- { MODKEY, XK_Tab, view, {0} },
- { MODKEY|ShiftMask, XK_c, killclient, {0} },
-diff -r 050d521d66d8 movestack.c
---- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/movestack.c Sun Sep 05 18:43:07 2010 +0200
-_AT_@ -0,0 +1,49 @@
-+void
-+movestack(const Arg *arg) {
-+ Client *c = NULL, *p = NULL, *pc = NULL, *i;
-+
-+ if(arg->i > 0) {
-+ /* find the client after selmon->sel */
-+ for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
-+ if(!c)
-+ for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
-+
-+ }
-+ else {
-+ /* find the client before selmon->sel */
-+ for(i = selmon->clients; i != selmon->sel; i = i->next)
-+ if(ISVISIBLE(i) && !i->isfloating)
-+ c = i;
-+ if(!c)
-+ for(; i; i = i->next)
-+ if(ISVISIBLE(i) && !i->isfloating)
-+ c = i;
-+ }
-+ /* find the client before selmon->sel and c */
-+ for(i = selmon->clients; i && (!p || !pc); i = i->next) {
-+ if(i->next == selmon->sel)
-+ p = i;
-+ if(i->next == c)
-+ pc = i;
-+ }
-+
-+ /* swap c and selmon->sel selmon->clients in the selmon->clients list */
-+ if(c && c != selmon->sel) {
-+ Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
-+ selmon->sel->next = c->next==selmon->sel?c:c->next;
-+ c->next = temp;
-+
-+ if(p && p != c)
-+ p->next = c;
-+ if(pc && pc != selmon->sel)
-+ pc->next = selmon->sel;
-+
-+ if(selmon->sel == selmon->clients)
-+ selmon->clients = c;
-+ else if(c == selmon->clients)
-+ selmon->clients = selmon->sel;
-+
-+ arrange(selmon);
-+ }
-+}
-+
diff --git a/dwm.suckless.org/patches/movestack-6.1.diff b/dwm.suckless.org/patches/movestack-6.1.diff
new file mode 100644
index 0000000..a6c83fa
--- /dev/null
+++ b/dwm.suckless.org/patches/movestack-6.1.diff
_AT_@ -0,0 +1,73 @@
+diff -r 050d521d66d8 config.def.h
+--- a/config.def.h Tue Aug 24 13:13:20 2010 +0100
++++ b/config.def.h Sun Sep 05 18:43:07 2010 +0200
+_AT_@ -57,6 +57,7 @@
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
+ static const char *termcmd[] = { "st", NULL };
+
++#include "movestack.c"
+ static Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
+_AT_@ -68,6 +69,8 @@
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
++ { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
++ { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+diff -r 050d521d66d8 movestack.c
+--- /dev/null Thu Jan 01 00:00:00 1970 +0000
++++ b/movestack.c Sun Sep 05 18:43:07 2010 +0200
+_AT_@ -0,0 +1,49 @@
++void
++movestack(const Arg *arg) {
++ Client *c = NULL, *p = NULL, *pc = NULL, *i;
++
++ if(arg->i > 0) {
++ /* find the client after selmon->sel */
++ for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
++ if(!c)
++ for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
++
++ }
++ else {
++ /* find the client before selmon->sel */
++ for(i = selmon->clients; i != selmon->sel; i = i->next)
++ if(ISVISIBLE(i) && !i->isfloating)
++ c = i;
++ if(!c)
++ for(; i; i = i->next)
++ if(ISVISIBLE(i) && !i->isfloating)
++ c = i;
++ }
++ /* find the client before selmon->sel and c */
++ for(i = selmon->clients; i && (!p || !pc); i = i->next) {
++ if(i->next == selmon->sel)
++ p = i;
++ if(i->next == c)
++ pc = i;
++ }
++
++ /* swap c and selmon->sel selmon->clients in the selmon->clients list */
++ if(c && c != selmon->sel) {
++ Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
++ selmon->sel->next = c->next==selmon->sel?c:c->next;
++ c->next = temp;
++
++ if(p && p != c)
++ p->next = c;
++ if(pc && pc != selmon->sel)
++ pc->next = selmon->sel;
++
++ if(selmon->sel == selmon->clients)
++ selmon->clients = c;
++ else if(c == selmon->clients)
++ selmon->clients = selmon->sel;
++
++ arrange(selmon);
++ }
++}
++
diff --git a/dwm.suckless.org/patches/movestack.md b/dwm.suckless.org/patches/movestack.md
index e79ca0b..0f36095 100644
--- a/dwm.suckless.org/patches/movestack.md
+++ b/dwm.suckless.org/patches/movestack.md
_AT_@ -23,7 +23,8 @@ movestack(-1) will swap the client with the current focus with the previous clie
 
 ## Download
 
- * [dwm-5.8.2-movestack.diff](movestack-5.8.2.diff) (2.6k) (20101102)
+ * [dwm-6.1-movestack.diff](movestack-6.1.diff) (2.6k) (20160604)
+ * [dwm-5.8.2-movestack.diff](historical/dwm-5.8.2-movestack.diff) (2.6k) (20101102)
  * [dwm-5.6.1-movestack.diff][1] (2.4k) (20090911)
 
 ## Author
Received on Sat Jun 04 2016 - 18:47:55 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 04 2016 - 18:48:14 CEST