mirror of https://github.com/bakkeby/patches
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.
44 lines
1.2 KiB
Diff
44 lines
1.2 KiB
Diff
4 years ago
|
From 1574ebb71bfa26e569983ccba58629fd72a5991e Mon Sep 17 00:00:00 2001
|
||
|
From: bakkeby <bakkeby@gmail.com>
|
||
|
Date: Tue, 27 Oct 2020 12:20:31 +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 4465af1..5ebc90e 100644
|
||
|
--- a/dwm.c
|
||
|
+++ b/dwm.c
|
||
|
@@ -802,6 +802,8 @@ focus(Client *c)
|
||
|
XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
|
||
|
}
|
||
|
selmon->sel = c;
|
||
|
+ if (selmon->lt[selmon->sellt]->arrange == monocle)
|
||
|
+ arrangemon(selmon);
|
||
|
drawbars();
|
||
|
}
|
||
|
|
||
|
@@ -1111,8 +1113,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
|
||
|
|