From f8291560008d3477b56ca1e3de42a6b7b41c15ac Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Sun, 13 Sep 2026 13:12:57 +1000 Subject: [PATCH] fix: size fullscreen entries to the output on every layout --- kick.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/kick.c b/kick.c index 12bd0c7..de19952 100644 --- a/kick.c +++ b/kick.c @@ -5424,23 +5424,26 @@ static void layer_full_area(struct wlr_box *box) { } } -/* Abort any max/fullscreen state and re-size the maximized clients into the - given usable box, mirroring output_resize's loop. A live-fullscreen - entry keeps its output-sized configure untouched (sizing it here would - fight it) -- only its scene position is re-synced -- so a hidden - fullscreen entry is intact on return; every other window is maximized - into the box, whatever the aggregate state. */ -static void resize_tabs_to_usable(const struct wlr_box *usable) { +/* Re-size clients into the layout boxes, mirroring output_resize's loop. A + live-fullscreen entry tracks the *output* size, never the usable box: + sizing it into usable would shrink a hidden entry wrongly, and skipping + it entirely would leave a newly fullscreened entry painting small at the + top-left with blank space (nested grows the output on fullscreen, so the + entry must learn the new size here). Every other window is maximized + into the usable box. Scene positions re-sync for all. */ +static void resize_tabs_to_usable(const struct wlr_box *usable, + const struct wlr_box *full) { struct kick_tab *tab; wl_list_for_each(tab, &server.tabs, link) { struct kick_window *w; wl_list_for_each(w, &tab->windows, link) { if (!window_live(w)) continue; - bool fs = window_is_fullscreen(w); - if (!fs) + if (window_is_fullscreen(w)) { + window_set_size(w, full->width, full->height); + } else { window_set_maximized(w, true); - if (!fs) window_set_size(w, usable->width, usable->height); + } /* Move the tab content down/right past a bar's reserved edge now, not only on the client's next commit. These are idempotent: position_window does nothing for X11 windows and @@ -5520,8 +5523,8 @@ static void layer_configure_class(enum zwlr_layer_shell_v1_layer want, takes the whole output: layer surfaces keep their geometry (so they return intact when a normal entry is shown again) but their exclusive-zone reservations are discarded and the tabs are sized to the full area. - A hidden fullscreen entry keeps its own output-sized configure via the - resize loop's per-window skip. */ + A hidden fullscreen entry is sized to the full box (not the usable + one) by the resize loop's per-window rule. */ static void layer_apply_layout_box(const struct wlr_box *full) { struct wlr_box usable = *full; @@ -5538,7 +5541,7 @@ static void layer_apply_layout_box(const struct wlr_box *full) { server.layout_x = full->x; server.layout_y = full->y; - resize_tabs_to_usable(full); + resize_tabs_to_usable(full, full); kick_request_redraw(); return; } @@ -5554,7 +5557,7 @@ static void layer_apply_layout_box(const struct wlr_box *full) { server.layout_x = usable.x; server.layout_y = usable.y; - resize_tabs_to_usable(&usable); + resize_tabs_to_usable(&usable, full); kick_request_redraw(); }