diff --git a/README.md b/README.md index f03a68e..1a7dbc3 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file + - adds options for specifying dmenu window position and width diff --git a/config.def.h b/config.def.h index f215a9d..775ea3e 100644 --- a/config.def.h +++ b/config.def.h @@ -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 diff --git a/dmenu.c b/dmenu.c index c5bedb5..071e80d 100644 --- a/dmenu.c +++ b/dmenu.c @@ -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];