[wiki] [sites] [dwm][PATCH] float border color updated for version 6.2 || MLquest8
commit a4a5a0259f0ea0b7092859ef29acdd7884d4746d
Author: MLquest8 <miskuzius_AT_gmail.com>
Date: Sun Jun 14 13:57:27 2020 +0400
[dwm][PATCH] float border color updated for version 6.2
diff --git a/dwm.suckless.org/patches/float_border_color/dwm-float-border-color-6.2.diff b/dwm.suckless.org/patches/float_border_color/dwm-float-border-color-6.2.diff
new file mode 100644
index 00000000..3c972f31
--- /dev/null
+++ b/dwm.suckless.org/patches/float_border_color/dwm-float-border-color-6.2.diff
_AT_@ -0,0 +1,97 @@
+From b8a19f1d4385e04478ec13a24b6ebababcf14139 Mon Sep 17 00:00:00 2001
+From: MLquest8 <miskuzius_AT_gmail.com>
+Date: Sun, 14 Jun 2020 13:52:57 +0400
+Subject: [PATCH] updated for version 6.2
+
+---
+ config.def.h | 8 ++++----
+ dwm.c | 19 ++++++++++++++++---
+ 2 files changed, 20 insertions(+), 7 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..27de552 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -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 9fd0286..da735c6 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -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 */
+_AT_@ -796,7 +797,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);
+_AT_@ -1052,7 +1056,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);
+_AT_@ -1063,6 +1070,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,
+_AT_@ -1570,7 +1579,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();
+_AT_@ -1717,6 +1726,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);
+--
+2.26.2
+
diff --git a/dwm.suckless.org/patches/float_border_color/index.md b/dwm.suckless.org/patches/float_border_color/index.md
index 821d986b..93b2558f 100644
--- a/dwm.suckless.org/patches/float_border_color/index.md
+++ b/dwm.suckless.org/patches/float_border_color/index.md
_AT_@ -7,11 +7,13 @@ This patch allows you to specify a different border color for floating windows.
Download
--------
+* [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)
* [dwm-float\_border\_color-6.0.diff](dwm-float_border_color-6.0.diff)
Author
------
+* Updated for 6.2 by MLquest8 (miskuzius at gmail.com)
* Message-ID: <20070626093131.GA5005_AT_shota.mine.nu>
* Updated by Jan Christoph Ebersbach - <jceb_AT_e-jc.de>
Received on Sun Jun 14 2020 - 11:58:56 CEST
This archive was generated by hypermail 2.3.0
: Sun Jun 14 2020 - 12:00:45 CEST