diff --git a/dwl.c b/dwl.c index 3353919..f0ed306 100644 --- a/dwl.c +++ b/dwl.c @@ -599,7 +599,9 @@ applyrules(Client *c) void arrange(Monitor *m) { - Client *c; + LayerSurface *l; + Client *c, *sel = focustop(m, 0); + int i; if (!m->wlr_output->enabled) return; @@ -630,6 +632,26 @@ arrange(Monitor *m) : c->scene->node.parent); } + if (sel && sel->isfullscreen && VISIBLEON(sel, m)) { + for (i = 2; 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->node, 0); + } + + wl_list_for_each(c, &clients, link) { + if (c->mon != m) + continue; + wlr_scene_node_set_enabled(&c->scene->node, (sel->isfullscreen && c == sel) + || !sel->isfullscreen); + } + } + if (!sel || (!sel->isfullscreen && VISIBLEON(sel, m))) { + for (i = 2; i > ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i--) { + wl_list_for_each(l, &m->layers[i], link) + wlr_scene_node_set_enabled(&l->scene->node, 1); + } + } + if (m->lt[m->sellt]->arrange) m->lt[m->sellt]->arrange(m); motionnotify(0, NULL, 0, 0, 0, 0);