aboutsummaryrefslogtreecommitdiffstats
path: root/dmenu-center-4.8.diff
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-04-22 06:08:33 +0000
committerterminaldweller <thabogre@gmail.com>2022-04-22 06:08:33 +0000
commit6fff7c34f07aa7b3ad504654eab310f63f44ad4c (patch)
tree02925cfc81b02d93fbccaea74f8d40ec2da868f7 /dmenu-center-4.8.diff
parentinitial commit (diff)
downloaddmenu-6fff7c34f07aa7b3ad504654eab310f63f44ad4c.tar.gz
dmenu-6fff7c34f07aa7b3ad504654eab310f63f44ad4c.zip
added center patch
Diffstat (limited to 'dmenu-center-4.8.diff')
-rw-r--r--dmenu-center-4.8.diff19
1 files changed, 19 insertions, 0 deletions
diff --git a/dmenu-center-4.8.diff b/dmenu-center-4.8.diff
new file mode 100644
index 0000000..5878a33
--- /dev/null
+++ b/dmenu-center-4.8.diff
@@ -0,0 +1,19 @@
+diff --git a/dmenu.c b/dmenu.c
+index 5e9c367..2268ea9 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -634,11 +644,10 @@ setup(void)
+ if (!XGetWindowAttributes(dpy, parentwin, &wa))
+ die("could not get embedding window attributes: 0x%lx",
+ parentwin);
+- x = 0;
+- y = topbar ? 0 : wa.height - mh;
+- mw = wa.width;
++ mw = MIN(MAX(max_textw() + promptw, 100), wa.width);
++ x = (wa.width - mw) / 2;
++ y = (wa.height - mh) / 2;
+ }
+- promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0;
+ inputw = MIN(inputw, mw/3);
+ match();
+