From b294c8aa64697ec43226912a14b45a232c3c7b2a Mon Sep 17 00:00:00 2001 From: tokyo4j Date: Mon, 12 Jan 2026 17:44:20 +0900 Subject: [PATCH] view: rename `last_layout_geometry` to `last_placement.layout_geo` --- include/view.h | 4 +++- src/view.c | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/view.h b/include/view.h index 9c5cd7dc..84a91e07 100644 --- a/include/view.h +++ b/include/view.h @@ -218,7 +218,9 @@ struct view { * last pending position will be saved so the view may be restored * to its original location on a subsequent layout change. */ - struct wlr_box last_layout_geometry; + struct { + struct wlr_box layout_geo; + } last_placement; /* Set temporarily when moving view due to layout change */ bool adjusting_for_layout_change; /* True if original output was disconnected or disabled */ diff --git a/src/view.c b/src/view.c index 7ddfc081..4bdb55ab 100644 --- a/src/view.c +++ b/src/view.c @@ -600,7 +600,7 @@ view_move_resize(struct view *view, struct wlr_box geo) * Not sure if it might have other side-effects though. */ if (!view->adjusting_for_layout_change) { - view->last_layout_geometry = (struct wlr_box){0}; + view->last_placement.layout_geo = (struct wlr_box){0}; view->lost_output_due_to_layout_change = false; } } @@ -1749,8 +1749,8 @@ view_adjust_for_layout_change(struct view *view) * case, there can be multiple layout change events, and a view * can be moved first and only later lose its own output. */ - if (wlr_box_empty(&view->last_layout_geometry)) { - view->last_layout_geometry = view->pending; + if (wlr_box_empty(&view->last_placement.layout_geo)) { + view->last_placement.layout_geo = view->pending; } /* * Check if an output change is required: @@ -1765,14 +1765,14 @@ view_adjust_for_layout_change(struct view *view) * output the view was on previously -- but this is simplest. */ if (is_floating || view->lost_output_due_to_layout_change) { - view_discover_output(view, &view->last_layout_geometry); + view_discover_output(view, &view->last_placement.layout_geo); } if (!is_floating) { view_apply_special_geometry(view); } else { /* Restore saved geometry, ensuring view is on-screen */ - struct wlr_box geometry = view->last_layout_geometry; + struct wlr_box geometry = view->last_placement.layout_geo; adjust_floating_geometry(view, &geometry, /* midpoint_visibility */ true); view_move_resize(view, geometry);