summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackson Taylor <jtaylor@classicalconversations.com>2023-06-14 16:28:50 -0400
committerJackson Taylor <jtaylor@classicalconversations.com>2023-06-14 16:28:50 -0400
commit9a5411e77d5ce9345fa8d610ca8d5c032db92a60 (patch)
tree78a1f5fcde47010ed339dbf17db11bf2a08286df
parent6520ba229640a579d02c72fa095db8040a43c32d (diff)
Add alwayscenter patch
All floating windows are centered
-rw-r--r--dwm.c2
-rw-r--r--patches/dwm-alwayscenter-20200625-f04cac6.diff12
2 files changed, 14 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index f1d86b2c..3c07f6b8 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1068,6 +1068,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 00000000..03ea9ef2
--- /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)