dmenu-border-5.2.diff (1276B)
1 diff --git a/config.def.h b/config.def.h 2 index 1edb647..dd3eb31 100644 3 --- a/config.def.h 4 +++ b/config.def.h 5 @@ -21,3 +21,6 @@ static unsigned int lines = 0; 6 * for example: " /?\"&[]" 7 */ 8 static const char worddelimiters[] = " "; 9 + 10 +/* Size of the window border */ 11 +static unsigned int border_width = 0; 12 diff --git a/dmenu.c b/dmenu.c 13 index 27b7a30..7c130fc 100644 14 --- a/dmenu.c 15 +++ b/dmenu.c 16 @@ -684,9 +684,11 @@ setup(void) 17 swa.override_redirect = True; 18 swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; 19 swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask; 20 - win = XCreateWindow(dpy, parentwin, x, y, mw, mh, 0, 21 + win = XCreateWindow(dpy, parentwin, x, y, mw, mh, border_width, 22 CopyFromParent, CopyFromParent, CopyFromParent, 23 CWOverrideRedirect | CWBackPixel | CWEventMask, &swa); 24 + if (border_width) 25 + XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel); 26 XSetClassHint(dpy, win, &ch); 27 28 29 @@ -757,6 +759,8 @@ main(int argc, char *argv[]) 30 colors[SchemeSel][ColFg] = argv[++i]; 31 else if (!strcmp(argv[i], "-w")) /* embedding window id */ 32 embed = argv[++i]; 33 + else if (!strcmp(argv[i], "-bw")) 34 + border_width = atoi(argv[++i]); /* border width */ 35 else 36 usage(); 37