From 94f0c8517945960e000c4da2a22804174f384e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sun, 10 Apr 2022 22:38:53 -0500 Subject: [PATCH] hide-behind-fullscreen --- config.def.h | 2 +- dwl.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index c12793c..fbd59dc 100644 --- a/config.def.h +++ b/config.def.h @@ -13,7 +13,7 @@ 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}; /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ -static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; +static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 0.0}; /* tagging */ static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; diff --git a/dwl.c b/dwl.c index 55b8017..049b0a4 100644 --- a/dwl.c +++ b/dwl.c @@ -586,11 +586,27 @@ applyrules(Client *c) void arrange(Monitor *m) { - Client *c; + LayerSurface *l; + Client *c, *sel = selclient(); + int i; wl_list_for_each(c, &clients, link) if (c->mon == m) wlr_scene_node_set_enabled(c->scene, VISIBLEON(c, m)); + if (sel && sel->isfullscreen && VISIBLEON(sel, m)) { + for (i = 3; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) + wl_list_for_each(l, &sel->mon->layers[i], link) + wlr_scene_node_set_enabled(l->scene, 0); + + wl_list_for_each(c, &clients, link) + wlr_scene_node_set_enabled(c->scene, (sel->isfullscreen && c == sel) + || !sel->isfullscreen); + } + if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) + for (i = 3; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) + wl_list_for_each(l, &m->layers[i], link) + wlr_scene_node_set_enabled(l->scene, 1); + if (m && m->lt[m->sellt]->arrange) m->lt[m->sellt]->arrange(m); motionnotify(0, NULL, 0, 0, 0, 0);