summaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authortsxv478 <vt0451@yandex.ru>2022-09-27 11:15:26 +0300
committertsxv478 <vt0451@yandex.ru>2022-09-27 11:15:26 +0300
commitfee8a5dc7722d80364be4023ed01e3993d454506 (patch)
tree7c6c5b9723dd2810b04becfa70e128436ae8ceb6 /dmenu.c
parentb4bc76e60ba9ce971a317a00d17c0acbfd085066 (diff)
always show border when centered
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dmenu.c b/dmenu.c
index 1d3f277..78c4727 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -55,6 +55,8 @@ static Clr *scheme[SchemeLast];
#include "config.h"
+static unsigned int border_width = 0;
+
static int (*fstrncmp)(const char *, const char *, size_t) = strncmp;
static char *(*fstrstr)(const char *, const char *) = strstr;
@@ -669,6 +671,7 @@ setup(void)
if (centered) {
mw = centered_width;
+ border_width = bw;
x = info[i].x_org + ((info[i].width - mw) / 2);
y = info[i].y_org + ((info[i].height - mh) / 2);
} else {
@@ -687,6 +690,7 @@ setup(void)
if (centered) {
mw = centered_width;
+ border_width = bw;
x = (wa.width - mw) / 2;
y = (wa.height - mh) / 2;
} else {
@@ -783,7 +787,7 @@ main(int argc, char *argv[])
else if (!strcmp(argv[i], "-w")) /* embedding window id */
embed = argv[++i];
else if (!strcmp(argv[i], "-bw"))
- border_width = atoi(argv[++i]); /* border width */
+ border_width = bw = atoi(argv[++i]); /* border width */
else
usage();