From a700300fabd1c5e043abca9b3f2fe7dcd328b73f Mon Sep 17 00:00:00 2001 From: mrsu Date: Sun, 16 Jun 2024 16:13:27 +0100 Subject: [PATCH] patch always centre --- dwm.c | 2 ++ patches/dwm-alwayscenter-20200625-f04cac6.diff | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 patches/dwm-alwayscenter-20200625-f04cac6.diff diff --git a/dwm.c b/dwm.c index 5facf4e..57e980d 100644 --- a/dwm.c +++ b/dwm.c @@ -1200,6 +1200,8 @@ manage(Window w, XWindowAttributes *wa) updatewindowtype(c); updatesizehints(c); updatewmhints(c); + c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; + c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); grabbuttons(c, 0); if (!c->isfloating) diff --git a/patches/dwm-alwayscenter-20200625-f04cac6.diff b/patches/dwm-alwayscenter-20200625-f04cac6.diff new file mode 100644 index 0000000..03ea9ef --- /dev/null +++ b/patches/dwm-alwayscenter-20200625-f04cac6.diff @@ -0,0 +1,12 @@ +diff -up dwm/dwm.c dwmmod/dwm.c +--- dwm/dwm.c 2020-06-25 00:21:30.383692180 -0300 ++++ dwmmod/dwm.c 2020-06-25 00:20:35.643692330 -0300 +@@ -1057,6 +1057,8 @@ manage(Window w, XWindowAttributes *wa) + updatewindowtype(c); + updatesizehints(c); + updatewmhints(c); ++ c->x = c->mon->mx + (c->mon->mw - WIDTH(c)) / 2; ++ c->y = c->mon->my + (c->mon->mh - HEIGHT(c)) / 2; + XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); + grabbuttons(c, 0); + if (!c->isfloating)