commit 8e43e92ea78b4cacead5c476e2f5c76e2198931c
parent 4c6820d285b5b7f6b402d3d43a20f5454a691130
Author: hhvn <hayden@haydenvh.com>
Date: Sat, 12 Dec 2020 23:21:07 +0000
config.h dwm.c: add scheme[SchemeNormFloat] to define border of an unselected floating window
Diffstat:
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/config.h b/config.h
@@ -9,11 +9,12 @@ static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "monospace:size=8" };
static const char *colors[][3] = {
/* fg bg border */
- [SchemeNorm] = { "#bbbbbb", "#0a0a10", "#0a0a10" },
- [SchemeSel] = { "#eeeeee", "#30404e", "#892b2b" },
- [SchemeStat] = { "#eeeeee", "#0a2126", "#0a2126" },
- [SchemeNormWin] = { "#bbbbbb", "#24284c", "#0a0a10" },
- [SchemeUrgent] = { "#892b2b", "#0a0a10", "#0a0a10" },
+ [SchemeNorm] = { "#bbbbbb", "#0a0a10", "#0a0a10" },
+ [SchemeSel] = { "#eeeeee", "#30404e", "#892b2b" },
+ [SchemeStat] = { "#eeeeee", "#0a2126", "#0a2126" },
+ [SchemeNormWin] = { "#bbbbbb", "#24284c", "#0a0a10" },
+ [SchemeNormFloat] = { "#bbbbbb", "#0a0a10", "#0a2126" },
+ [SchemeUrgent] = { "#892b2b", "#0a0a10", "#0a0a10" },
};
/* tagging */
diff --git a/dwm.c b/dwm.c
@@ -68,7 +68,7 @@
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeSel, SchemeStat, SchemeNormWin, SchemeUrgent }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeStat, SchemeNormWin, SchemeUrgent, SchemeNormFloat}; /* color schemes */
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
@@ -1150,7 +1150,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[SchemeNormFloat][ColBorder].pixel);
+ else
+ XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
configure(c); /* propagates border_width, if size doesn't change */
updatewindowtype(c);
updatesizehints(c);
@@ -1756,7 +1759,10 @@ unfocus(Client *c, int setfocus)
{
if (!c)
return;
- XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
+ if (c->isfloating)
+ XSetWindowBorder(dpy, c->win, scheme[SchemeNormFloat][ColBorder].pixel);
+ else
+ XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
if (setfocus) {
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);