[dmenu][border] Revised Dmenu Border Patch

This commit is contained in:
bakkeby 2020-02-09 08:48:00 +01:00
parent d7f418468d
commit db891f3f9b
3 changed files with 14 additions and 4 deletions

View File

@ -15,6 +15,8 @@ Refer to [https://tools.suckless.org/dmenu/](https://tools.suckless.org/dmenu/)
### Changelog:
2020-02-09 - Added revised border patch (adding command line parameter for setting border width)
2019-12-29 - Added xresources patch
2019-10-16 - Introduced [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer)
@ -89,4 +91,4 @@ Refer to [https://tools.suckless.org/dmenu/](https://tools.suckless.org/dmenu/)
- note that with this patch the Xresources settings takes precedence over command line arguments
- [xyw](https://tools.suckless.org/dmenu/patches/xyw/)
- adds options for specifying dmenu window position and width
- adds options for specifying dmenu window position and width

View File

@ -47,7 +47,7 @@ static const char worddelimiters[] = " ";
#if BORDER_PATCH
/* Size of the window border */
static const unsigned int border_width = 5;
static unsigned int border_width = 0;
#endif // BORDER_PATCH
#if PREFIXCOMPLETION_PATCH

12
dmenu.c
View File

@ -988,7 +988,8 @@ setup(void)
CopyFromParent, CopyFromParent, CopyFromParent,
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
#if BORDER_PATCH
XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
if (border_width)
XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
#endif // BORDER_PATCH
XSetClassHint(dpy, win, &ch);
#if WMTYPE_PATCH
@ -1051,9 +1052,12 @@ usage(void)
#endif // REJECTNOMATCH_PATCH
"] [-l lines] [-p prompt] [-fn font] [-m monitor]"
"\n [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]"
#if INITIALTEXT_PATCH || LINE_HEIGHT_PATCH
#if BORDER_PATCH || INITIALTEXT_PATCH || LINE_HEIGHT_PATCH || NAVHISTORY_PATCH || XYW_PATCH
"\n "
#endif
#if BORDER_PATCH
" [-bw width]"
#endif // BORDER_PATCH
#if INITIALTEXT_PATCH
" [-it text]"
#endif // INITIALTEXT_PATCH
@ -1164,6 +1168,10 @@ main(int argc, char *argv[])
colors[SchemeSel][ColFg] = argv[++i];
else if (!strcmp(argv[i], "-w")) /* embedding window id */
embed = argv[++i];
#if BORDER_PATCH
else if (!strcmp(argv[i], "-bw")) /* border width around dmenu */
border_width = atoi(argv[++i]);
#endif // BORDER_PATCH
#if INITIALTEXT_PATCH
else if (!strcmp(argv[i], "-it")) { /* adds initial text */
const char * text = argv[++i];