mirror of
https://github.com/labwc/labwc.git
synced 2026-02-04 04:06:25 -05:00
view: rename last_layout_geometry to last_placement.layout_geo
This commit is contained in:
parent
20929c0484
commit
b294c8aa64
2 changed files with 8 additions and 6 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
10
src/view.c
10
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue