[wiki] [sites] [dwm][patch][movecenter] Updated patch to work on 6.4 release || Philip Thomas Kanianthara

From: <git_AT_suckless.org>
Date: Sat, 10 Feb 2024 03:24:54 +0100

commit 3818889a2d41855de435531355bff1f665425510
Author: Philip Thomas Kanianthara <philip.kanianthara_AT_gmail.com>
Date: Sat Feb 10 10:23:08 2024 +0800

    [dwm][patch][movecenter] Updated patch to work on 6.4 release

diff --git a/dwm.suckless.org/patches/movecenter/dwm-movecenter-6.4.diff b/dwm.suckless.org/patches/movecenter/dwm-movecenter-6.4.diff
new file mode 100644
index 00000000..b3a19739
--- /dev/null
+++ b/dwm.suckless.org/patches/movecenter/dwm-movecenter-6.4.diff
_AT_@ -0,0 +1,52 @@
+From 2eb73abfbc2a81ac5f6548ebc9b3db660d1be179 Mon Sep 17 00:00:00 2001
+From: Philip Thomas Kanianthara <philip.kanianthara_AT_gmail.com>
+Date: Fri, 9 Feb 2024 14:18:00 +0800
+Subject: [PATCH] Applied movecenter patch manually, with compile check
+
+---
+ config.def.h | 1 +
+ dwm.c | 9 +++++++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 061ad66..0b767a7 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -84,6 +84,7 @@ static const Key keys[] = {
+ { MODKEY, XK_period, focusmon, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
++ { MODKEY, XK_x, movecenter, {0} },
+ TAGKEYS( XK_1, 0)
+ TAGKEYS( XK_2, 1)
+ TAGKEYS( XK_3, 2)
+diff --git a/dwm.c b/dwm.c
+index e5efb6a..e6846a2 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -184,6 +184,7 @@ static void maprequest(XEvent *e);
+ static void monocle(Monitor *m);
+ static void motionnotify(XEvent *e);
+ static void movemouse(const Arg *arg);
++static void movecenter(const Arg *arg);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *c);
+ static void propertynotify(XEvent *e);
+_AT_@ -1193,6 +1194,14 @@ movemouse(const Arg *arg)
+ }
+ }
+
++void
++movecenter(const Arg *arg)
++{
++ selmon->sel->x = selmon->sel->mon->mx + (selmon->sel->mon->mw - WIDTH(selmon->sel)) / 2;
++ selmon->sel->y = selmon->sel->mon->my + (selmon->sel->mon->mh - HEIGHT(selmon->sel)) / 2;
++ arrange(selmon);
++}
++
+ Client *
+ nexttiled(Client *c)
+ {
+--
+2.34.1
+
diff --git a/dwm.suckless.org/patches/movecenter/index.md b/dwm.suckless.org/patches/movecenter/index.md
index 43e86aca..f54323a4 100644
--- a/dwm.suckless.org/patches/movecenter/index.md
+++ b/dwm.suckless.org/patches/movecenter/index.md
_AT_@ -15,6 +15,7 @@ The original code is from the [togglefloatingcenter](../togglefloatingcenter/) p
 Download
 --------
 * [dwm-movecenter-6.2.diff](dwm-movecenter-6.2.diff) - 2021-10-31
+* [dwm-movecenter-6.4.diff](dwm-movecenter-6.4.diff) - 2024-02-10
 
 Author
 ------
Received on Sat Feb 10 2024 - 03:24:54 CET

This archive was generated by hypermail 2.3.0 : Sat Feb 10 2024 - 03:36:44 CET