summaryrefslogtreecommitdiff
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
parentb4bc76e60ba9ce971a317a00d17c0acbfd085066 (diff)
always show border when centered
-rw-r--r--config.def.h4
-rw-r--r--dmenu.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h
index 2602882..c96fd4b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -22,5 +22,5 @@ static unsigned int lines = 0;
* for example: " /?\"&[]" */
static const char worddelimiters[] = " ";
-/* Size of the window border */
-static unsigned int border_width = 0;
+/* Size of the window border when centered */
+static unsigned int bw = 3;
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();