summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index a883124..fc390c2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -61,6 +61,7 @@
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define ColFloat 3
+#define ColMaster 4
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@@ -776,10 +777,14 @@ focus(Client *c)
detachstack(c);
attachstack(c);
grabbuttons(c, 1);
- if(c->isfloating)
- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel);
- else
- XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel);
+
+ if (c == nexttiled(selmon->clients)) {
+ XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColMaster].pixel);
+ } else 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);
@@ -1045,10 +1050,14 @@ manage(Window w, XWindowAttributes *wa)
wc.border_width = c->bw;
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- if(c->isfloating)
+
+ if (c == nexttiled(selmon->clients)) {
+ XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColMaster].pixel);
+ } else if(c->isfloating) {
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel);
- else
+ } else
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel);
+
configure(c); /* propagates border_width, if size doesn't change */
updatewindowtype(c);
updatesizehints(c);
@@ -1659,8 +1668,10 @@ setup(void)
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
/* init appearance */
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
- for (i = 0; i < LENGTH(colors); i++)
+ for (i = 0; i < LENGTH(colors); i++) {
scheme[i] = drw_scm_create(drw, colors[i], 4);
+ scheme[i] = drw_scm_create(drw, colors[i], 5);
+ }
/* init mouse */
if (mouse_default == 0) {
@@ -1798,8 +1809,13 @@ togglefloating(const Arg *arg)
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);
+ else {
+ if (selmon->sel == nexttiled(selmon->clients)) {
+ XSetWindowBorder(dpy, selmon->sel->win, scheme[SchemeSel][ColMaster].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);