summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Rumbaugh <doug@douglasrumbaugh.com>2021-12-19 19:31:55 -0500
committerDouglas Rumbaugh <doug@douglasrumbaugh.com>2021-12-19 19:31:55 -0500
commit7a903cc9e33a0e33629d09de8c5bdba660b2334e (patch)
tree097d42e621b3284967fa58fc9771ebc972057211
parent9a590e457f7436fdcde6bb103245315de369d66d (diff)
downloaddmenu-7a903cc9e33a0e33629d09de8c5bdba660b2334e.tar.gz
Applied border width w/ command option patch
https://tools.suckless.org/dmenu/patches/border/
-rw-r--r--config.def.h3
-rw-r--r--dmenu.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h
index 1edb647..dd3eb31 100644
--- a/config.def.h
+++ b/config.def.h
@@ -21,3 +21,6 @@ static unsigned int lines = 0;
* for example: " /?\"&[]"
*/
static const char worddelimiters[] = " ";
+
+/* Size of the window border */
+static unsigned int border_width = 0;
diff --git a/dmenu.c b/dmenu.c
index c5646fa..690db12 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -680,9 +680,11 @@ setup(void)
swa.override_redirect = True;
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
- win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0,
+ win = XCreateWindow(dpy, parentwin, x, y - (topbar ? 0 : border_width * 2), mw - border_width * 2, mh, border_width,
CopyFromParent, CopyFromParent, CopyFromParent,
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
+ if (border_width)
+ XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
XSetClassHint(dpy, win, &ch);
@@ -789,6 +791,8 @@ main(int argc, char *argv[])
colortemp[3] = argv[++i];
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 */
else
usage();