aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-05-23 09:41:00 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-05-23 09:41:00 +0200
commit98f676d010ff9a4c750d8816d6d90d303d2ba483 (patch)
tree7a3715e541b4bd34411a09a6e1001f3ac9064ce9 /dwm.c
parentec1a6b3891946eb2cc556ead0b1b57392e57f370 (diff)
downloaddwm-98f676d010ff9a4c750d8816d6d90d303d2ba483.tar.gz
dwm-98f676d010ff9a4c750d8816d6d90d303d2ba483.tar.bz2
dwm-98f676d010ff9a4c750d8816d6d90d303d2ba483.zip
update
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index 170d273..39a5717 100644
--- a/dwm.c
+++ b/dwm.c
@@ -184,6 +184,7 @@ static void configure(Client *c);
static void configurenotify(XEvent *e);
static void configurerequest(XEvent *e);
static Monitor *createmon(void);
+static void deck(Monitor *m);
static void destroynotify(XEvent *e);
static void detach(Client *c);
static void detachstack(Client *c);
@@ -768,6 +769,31 @@ destroynotify(XEvent *e)
}
void
+deck(Monitor *m) {
+ unsigned int i, n, h, mw, my;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if(n == 0)
+ return;
+
+ if(n > m->nmaster) {
+ mw = m->nmaster ? m->ww * m->mfact : 0;
+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m->nmaster);
+ }
+ else
+ mw = m->ww;
+ for(i = my = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if(i < m->nmaster) {
+ h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+ resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
+ my += HEIGHT(c);
+ }
+ else
+ resize(c, m->wx + mw, m->wy, m->ww - mw - (2*c->bw), m->wh - (2*c->bw), False);
+}
+
+void
detach(Client *c)
{
Client **tc;