focus the dialogs of a fullscreen client

Since a6e2c15 focustop() returns the fullscreen client even when one of
its children is shown above it, so a dialog opened by a fullscreen client
(a file chooser, say) was shown on top but didn't get focus. Let focustop()
return the fullscreen client's children too, and keep fullscreen_bg on
while one of them is focused.
This commit is contained in:
dvh
2026-11-11 10:54:13 +01:00
parent d1f58218b3
commit 8df3f1f96f
+12 -7
View File
@@ -1744,14 +1744,18 @@ focusstack(const Arg *arg)
Client *
focustop(Monitor *m)
{
Client *c;
Client *c, *fs = NULL;
wl_list_for_each(c, &fstack, flink)
if (VISIBLEON(c, m) && c->isfullscreen)
return c;
wl_list_for_each(c, &fstack, flink) {
if (VISIBLEON(c, m) && c->isfullscreen) {
fs = c;
break;
}
}
/* A fullscreen client's children are shown above it */
wl_list_for_each(c, &fstack, flink)
if (VISIBLEON(c, m))
if (VISIBLEON(c, m) && (!fs || c == fs || client_get_parent(c) == fs))
return c;
return NULL;
}
@@ -3185,7 +3189,7 @@ void
transactionapply(void)
{
struct wlr_scene_node **ghost;
Client *c;
Client *c, *p;
Monitor *m;
wl_event_source_timer_update(transaction_timer, 0);
@@ -3207,7 +3211,8 @@ transactionapply(void)
wl_list_for_each(m, &mons, link) {
if (m->wlr_output->enabled)
wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
(c = focustop(m)) && c->isfullscreen);
(c = focustop(m)) && (c->isfullscreen
|| ((p = client_get_parent(c)) && p->isfullscreen)));
}
motionnotify(0, NULL, 0, 0, 0, 0);