diff options
author | tsxv478 <vt0451@yandex.ru> | 2022-09-27 11:15:26 +0300 |
---|---|---|
committer | tsxv478 <vt0451@yandex.ru> | 2022-09-27 11:15:26 +0300 |
commit | fee8a5dc7722d80364be4023ed01e3993d454506 (patch) | |
tree | 7c6c5b9723dd2810b04becfa70e128436ae8ceb6 | |
parent | b4bc76e60ba9ce971a317a00d17c0acbfd085066 (diff) |
always show border when centered
-rw-r--r-- | config.def.h | 4 | ||||
-rw-r--r-- | dmenu.c | 6 |
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; @@ -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(); |