You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
patches/dwm/dwm-alpha_monocle_layout-6....

44 lines
1.2 KiB
Diff

From 945f4d84a9617c26769d2ee9c36d96dc39a5856f Mon Sep 17 00:00:00 2001
From: Bakkeby <bakkeby@gmail.com>
Date: Mon, 10 Jan 2022 11:08:27 +0100
Subject: [PATCH] alpha monocle layout: only show the currently focused window
(rather than all windows stacked on top of each other)
---
dwm.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dwm.c b/dwm.c
index a96f33c..05f9edb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -806,6 +806,8 @@ focus(Client *c)
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
}
selmon->sel = c;
+ if (selmon->lt[selmon->sellt]->arrange == monocle)
+ arrangemon(selmon);
drawbars();
}
@@ -1115,8 +1117,15 @@ monocle(Monitor *m)
n++;
if (n > 0) /* override layout symbol */
snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
- for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ for (c = m->stack; c && (!ISVISIBLE(c) || c->isfloating); c = c->snext);
+ if (c && !c->isfloating) {
+ XMoveWindow(dpy, c->win, m->wx, m->wy);
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
+ c = c->snext;
+ }
+ for (; c; c = c->snext)
+ if (!c->isfloating && ISVISIBLE(c))
+ XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y);
}
void
--
2.19.1