summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2023-02-21 13:47:13 -0600
committerzachir <zachir@librem.one>2023-02-21 13:47:13 -0600
commitaddad8d7671563820a8a10cb181e1034d1891678 (patch)
treeac2d62046eead2951c0abc9408064096618e7235
parent2e426cac046fdd057880eda259482db0e965aebd (diff)
add borderoption patch
-rw-r--r--config.def.h3
-rw-r--r--dmenu.c6
-rw-r--r--patches/dmenu-borderoption-20200217-bf60a1e.diff46
3 files changed, 54 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 a8eb321..dcc09da 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -696,9 +696,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, mw, mh, border_width,
CopyFromParent, CopyFromParent, CopyFromParent,
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
+ if (border_width)
+ XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
XSetClassHint(dpy, win, &ch);
@@ -770,6 +772,8 @@ main(int argc, char *argv[])
colors[SchemeSel][ColFg] = 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 if (!strcmp(argv[i], "-d") || /* field separator */
!strcmp(argv[i], "-D")) {
sepchr = argv[i][1] == 'D' ? strrchr : strchr;
diff --git a/patches/dmenu-borderoption-20200217-bf60a1e.diff b/patches/dmenu-borderoption-20200217-bf60a1e.diff
new file mode 100644
index 0000000..b9b5726
--- /dev/null
+++ b/patches/dmenu-borderoption-20200217-bf60a1e.diff
@@ -0,0 +1,46 @@
+From bf60a1eaf98c7aebae51021914e35bc73dd8c23e Mon Sep 17 00:00:00 2001
+From: 0x1bi <ben@0x1bi.net>
+Date: Mon, 17 Feb 2020 11:02:35 -0500
+Subject: [PATCH] added border with option
+
+
+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 65f25ce..f0c3c6f 100644
+--- a/dmenu.c
++++ b/dmenu.c
+@@ -659,9 +659,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, mw, mh, border_width,
+ CopyFromParent, CopyFromParent, CopyFromParent,
+ CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
++ if (border_width)
++ XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
+ XSetClassHint(dpy, win, &ch);
+
+
+@@ -733,6 +735,8 @@ main(int argc, char *argv[])
+ colors[SchemeSel][ColFg] = 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();
+
+--
+2.24.1
+