From 8df3f1f96f5e0c0fbccfc782e98152503f35ae8a Mon Sep 17 00:00:00 2001 From: dvh Date: Wed, 11 Nov 2026 10:07:32 +0100 Subject: [PATCH] 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. --- dwl.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dwl.c b/dwl.c index 259ebab..ce1f746 100644 --- a/dwl.c +++ b/dwl.c @@ -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);