commit 3d8753cc0a0b5936655779985f2eb17615a986c4
parent 2b1ff4f11e8e6e31cf2d59e207db9febe162e47c
Author: Gabriel A. López López <glpz@daxslab.com>
Date: Sun, 8 Oct 2023 22:51:36 -0400
[dwm][patches][float-border-color] Normal border color is set when the client loses focus
Diffstat:
2 files changed, 111 insertions(+), 0 deletions(-)
diff --git a/dwm.suckless.org/patches/float_border_color/dwm-float-border-color-20231008-3a7ea45f.diff b/dwm.suckless.org/patches/float_border_color/dwm-float-border-color-20231008-3a7ea45f.diff
@@ -0,0 +1,109 @@
+From 5f6716fa3fb7e28e6592872ce3de32b7aa0965a7 Mon Sep 17 00:00:00 2001
+From: glpzzz <glpz@daxslab.com>
+Date: Sun, 8 Oct 2023 16:44:37 -0400
+Subject: [PATCH] set the custom colored floating border on unfocus too.
+
+---
+ config.def.h | 8 ++++----
+ dwm.c | 24 ++++++++++++++++++++----
+ 2 files changed, 24 insertions(+), 8 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..ce68d1e 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -12,10 +12,10 @@ static const char col_gray2[] = "#444444";
+ static const char col_gray3[] = "#bbbbbb";
+ static const char col_gray4[] = "#eeeeee";
+ static const char col_cyan[] = "#005577";
+-static const char *colors[][3] = {
+- /* fg bg border */
+- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
++static const char *colors[][4] = {
++ /* fg bg border float */
++ [SchemeNorm] = { col_gray3, col_gray1, col_gray2, col_gray2 },
++ [SchemeSel] = { col_gray4, col_cyan, col_gray2, col_cyan },
+ };
+
+ /* tagging */
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..4182083 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -56,6 +56,7 @@
+ #define HEIGHT(X) ((X)->h + 2 * (X)->bw)
+ #define TAGMASK ((1 << LENGTH(tags)) - 1)
+ #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
++#define ColFloat 3
+
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
+@@ -801,7 +802,10 @@ focus(Client *c)
+ detachstack(c);
+ attachstack(c);
+ grabbuttons(c, 1);
+- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
++ if(c->isfloating)
++ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
++ else
++ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
+ setfocus(c);
+ } else {
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+@@ -1063,7 +1067,10 @@ manage(Window w, XWindowAttributes *wa)
+
+ wc.border_width = c->bw;
+ XConfigureWindow(dpy, w, CWBorderWidth, &wc);
+- XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
++ if(c->isfloating)
++ XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel);
++ else
++ XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
+ configure(c); /* propagates border_width, if size doesn't change */
+ updatewindowtype(c);
+ updatesizehints(c);
+@@ -1074,6 +1081,8 @@ manage(Window w, XWindowAttributes *wa)
+ c->isfloating = c->oldstate = trans != None || c->isfixed;
+ if (c->isfloating)
+ XRaiseWindow(dpy, c->win);
++ if(c->isfloating)
++ XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel);
+ attach(c);
+ attachstack(c);
+ XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend,
+@@ -1586,7 +1595,7 @@ setup(void)
+ /* init appearance */
+ scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
+ for (i = 0; i < LENGTH(colors); i++)
+- scheme[i] = drw_scm_create(drw, colors[i], 3);
++ scheme[i] = drw_scm_create(drw, colors[i], 4);
+ /* init bars */
+ updatebars();
+ updatestatus();
+@@ -1730,6 +1739,10 @@ togglefloating(const Arg *arg)
+ return;
+ selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
+ if (selmon->sel->isfloating)
++ XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColFloat].pixel);
++ else
++ XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColBorder].pixel);
++ if(selmon->sel->isfloating)
+ resize(selmon->sel, selmon->sel->x, selmon->sel->y,
+ selmon->sel->w, selmon->sel->h, 0);
+ arrange(selmon);
+@@ -1768,7 +1781,10 @@ unfocus(Client *c, int setfocus)
+ if (!c)
+ return;
+ grabbuttons(c, 0);
+- XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
++ if (c->isfloating)
++ XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColFloat].pixel);
++ else
++ XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
+ if (setfocus) {
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
+--
+2.39.2
+
diff --git a/dwm.suckless.org/patches/float_border_color/index.md b/dwm.suckless.org/patches/float_border_color/index.md
@@ -7,6 +7,7 @@ This patch allows you to specify a different border color for floating windows.
Download
--------
+* [dwm-float-border-color-20231008-3a7ea45f.diff](dwm-float-border-color-20231008-3a7ea45f.diff) (08/10/2023)
* [dwm-float-border-color-6.2.diff](dwm-float-border-color-6.2.diff) (14/06/2020)
* [dwm-float\_border\_color2-20160731-56a31dc.diff](dwm-float_border_color2-20160731-56a31dc.diff)
* [dwm-float\_border\_color-6.1.diff](dwm-float_border_color-6.1.diff) (Unclean patch)
@@ -14,6 +15,7 @@ Download
Author
------
+* Updated by Gabriel Alejandro López Lopez (glpz at daxslab.com): it sets the border color in the normal color scheme when the client loses the focus.
* Updated for 6.2 by MLquest8 (miskuzius at gmail.com)
* Message-ID: <20070626093131.GA5005@shota.mine.nu>
* Updated by Jan Christoph Ebersbach - <jceb@e-jc.de>