From 6e342e888c853caba2341f8553b65a26f01a1ca6 Mon Sep 17 00:00:00 2001 From: mrdotx Date: Mon, 26 Jul 2021 18:17:19 +0200 Subject: [PATCH] border_width added --- README | 1 + pinentry-dmenu.1 | 6 +++++- pinentry-dmenu.c | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README b/README index e69f6c5..9a145d2 100644 --- a/README +++ b/README @@ -32,6 +32,7 @@ monitor = -1; bottom = false; embedded = false; line_height = 26; +border_width = 0; font = "DejaVuSansMono Nerd Font:pixelsize=16:antialias=true:autohint=true"; min_password_length = 32; asterisk= "*"; diff --git a/pinentry-dmenu.1 b/pinentry-dmenu.1 index 431424a..31cbb8d 100644 --- a/pinentry-dmenu.1 +++ b/pinentry-dmenu.1 @@ -37,6 +37,9 @@ Embed into window. .BI "line_height =" " 26" Defines menu line of at least 'line_height' pixels tall. .TP +.BI "border_width =" " 0" +Defines the border width for the menu. +.TP .BI "font =" " DejaVuSansMono Nerd Font:pixelsize=16:antialias=true:autohint=true" Defines the font or font set used. .TP @@ -191,7 +194,8 @@ Paste from primary X selection monitor = -1; bottom = false; embedded = false; -lineheight = 26; +line_height = 26; +border_width = 0; font = "DejaVuSansMono Nerd Font:pixelsize=16:antialias=true:autohint=true"; min_passwword_length = 32; asterisk= "*"; diff --git a/pinentry-dmenu.c b/pinentry-dmenu.c index 1eb4bbd..5ce6a68 100644 --- a/pinentry-dmenu.c +++ b/pinentry-dmenu.c @@ -351,9 +351,11 @@ setup(void) { swa.override_redirect = True; swa.background_pixel = scheme[SchemePrompt][ColBg].pixel; swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; - win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0, + win = XCreateWindow(dpy, parentwin, x, y, mw, mh, borderwidth, CopyFromParent, CopyFromParent, CopyFromParent, CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); + if (borderwidth) + XSetWindowBorder(dpy, win, scheme[SchemeSelect][ColBg].pixel); /* Open input methods */ xim = XOpenIM(dpy, NULL, NULL, NULL); @@ -748,6 +750,9 @@ main(int argc, char *argv[]) { if (config_lookup_int(&cfg, "line_height", &val)) { lineheight = val; } + if (config_lookup_int(&cfg, "border_width", &val)) { + borderwidth = val; + } if (config_lookup_string(&cfg, "font", &str)) { fonts[0] = str; }