propagate host fullscreen to stacked tab-group members too

clients_set_fullscreen only told each tab's main surface, so members
stacked before a toggle never learned they were fullscreen, and members
that mapped during fullscreen were never released from it.  walk each
tab's member list with a member_set_fullscreen helper (mirroring the app
one) and give xdg members the same re-maximize/resize mains get on the
way out; X11 members keep their own geometry.  logged as
"members fullscreen=" next to the existing line.
This commit is contained in:
Andrew Hamilton 2026-08-24 23:25:31 +10:00
parent 86fe848acd
commit 87f25783d9
3 changed files with 65 additions and 6 deletions

35
kick.c
View file

@ -910,6 +910,21 @@ static void app_set_fullscreen(struct kick_app *app, bool on) {
#endif
}
/* Same as app_set_fullscreen() for a stacked tab-group member's own window;
the is_main wrapper is covered by its owner's call above. */
static void member_set_fullscreen(struct kick_tab_group_member *m, bool on) {
if (!m) return;
if (m->toplevel) {
if (!m->toplevel->base->initialized) return;
wlr_xdg_toplevel_set_fullscreen(m->toplevel, on);
return;
}
#if HAVE_XWAYLAND
if (m->is_x11 && m->xsurface)
wlr_xwayland_surface_set_fullscreen(m->xsurface, on);
#endif
}
/* Keep a mapped window at the maximized output size. XDG clients are told
via set_size; X11 clients get a configure to the full output at 0,0. */
static void app_set_size(struct kick_app *app, int width, int height) {
@ -2586,11 +2601,16 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
}
}
/* Propagate the host window's fullscreen state onto every client. Called
from host_xdg_toplevel_configure when that state actually changes. */
/* Propagate the host window's fullscreen state onto every client -- each
tab's main surface plus every tab-group member stacked on it. Called
from host_xdg_toplevel_configure when that state actually changes.
X11 members keep their own geometry (see attach_group_member), so only
xdg members get the re-maximize/resize mains receive on the way out;
windows arriving later pick the flag up at their first commit. */
static void clients_set_fullscreen(bool fs) {
server.clients_fullscreen = fs;
kick_log(KICK_LOG_INFO, "clients fullscreen=%d\n", fs);
kick_log(KICK_LOG_INFO, "members fullscreen=%d\n", fs);
for (int i = 0; i < server.num_apps; i++) {
struct kick_app *app = server.apps[i];
if (!app_initialized(app)) continue;
@ -2599,6 +2619,17 @@ static void clients_set_fullscreen(bool fs) {
app_set_maximized(app, true);
app_set_size(app, server.output->width, server.output->height);
}
struct kick_tab_group_member *m;
wl_list_for_each(m, &app->group_members, link) {
if (m->is_main) continue; /* already handled via the owner */
member_set_fullscreen(m, fs);
if (!fs && m->toplevel
&& m->toplevel->base->initialized) {
wlr_xdg_toplevel_set_maximized(m->toplevel, true);
wlr_xdg_toplevel_set_size(m->toplevel,
server.output->width, server.output->height);
}
}
}
}