fix: size fullscreen entries to the output on every layout
This commit is contained in:
parent
cb362b1519
commit
f829156000
1 changed files with 17 additions and 14 deletions
31
kick.c
31
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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue