make sure clients share the same layer on floating layout

This commit is contained in:
Leonardo Hernández Hernández 2024-05-30 17:48:01 -06:00
parent 8f6fca35d0
commit 21205f2f40
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

17
dwl.c
View File

@ -495,6 +495,20 @@ arrange(Monitor *m)
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
/* We move all clients (except fullscreen and unmanaged) to LyrTile while
* in floating layout to avoid "real" floating clients be always on top */
wl_list_for_each(c, &clients, link) {
if (c->mon != m || c->isfullscreen)
continue;
wlr_scene_node_reparent(&c->scene->node,
(!m->lt[m->sellt]->arrange && c->isfloating)
? layers[LyrTile]
: (m->lt[m->sellt]->arrange && c->isfloating)
? layers[LyrFloat]
: c->scene->node.parent);
}
if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
motionnotify(0, NULL, 0, 0, 0, 0);
@ -2198,7 +2212,8 @@ setfloating(Client *c, int floating)
{
Client *p = client_get_parent(c);
c->isfloating = floating;
if (!c->mon)
/* If in floating layout do not change the client's layer */
if (!c->mon || !c->mon->lt[c->mon->sellt]->arrange)
return;
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
(p && p->isfullscreen) ? LyrFS