aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2025-05-10 20:18:01 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2025-05-10 20:18:01 +0530
commitbd7e23dff2c22e1133ec7908f689b9e7b8d5704a (patch)
tree769eb0f7683fae42491a2ff4ccb334779d16cfee /dwm.c
parent7b54c80ec7c930598cfc44115bd710210298f6b8 (diff)
patched dwm-float-border-color-20231008-3a7ea45f.diff
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/dwm.c b/dwm.c
index 07e1f1a..78f6996 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 */
@@ -887,7 +888,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);
@@ -1149,7 +1153,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);
@@ -1160,6 +1167,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,
@@ -1768,7 +1777,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();
@@ -1912,6 +1921,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);
@@ -1950,7 +1963,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]);