From 8ba581f2ae7ec861e7e94efb9b57548506d42f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Wed, 20 Jul 2022 00:15:32 -0500 Subject: [PATCH] allow gaps in monocle layout if requested --- config.def.h | 1 + dwl.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 843ece5..c12793c 100644 --- a/config.def.h +++ b/config.def.h @@ -8,6 +8,7 @@ static const unsigned int gappiv = 10; /* vert inner gap between window static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ static const unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */ +static const int monoclegaps = 0; /* 1 means outer gaps in monocle layout */ static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; diff --git a/dwl.c b/dwl.c index 0d2580d..55b8017 100644 --- a/dwl.c +++ b/dwl.c @@ -1916,7 +1916,11 @@ monocle(Monitor *m) wl_list_for_each(c, &clients, link) { if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen) continue; - resize(c, m->w, 0, !smartborders); + if (!monoclegaps) + resize(c, m->w, 0, !smartborders); + else + resize(c, (struct wlr_box){.x = m->w.x + gappoh, .y = m->w.y + gappov, + .width = m->w.width - 2 * gappoh, .height = m->w.height - 2 * gappov}, 0, !smartborders); } if ((c = focustop(m))) wlr_scene_node_raise_to_top(c->scene);