view: rework saving/restoring geometry across layout changes

After several iterations, this is basically a complete re-work. The old
implementation was difficult to follow and sometimes failed to restore
fullscreen/maximized/tiled geometry correctly, since it was based
entirely on natural (floating) geometry.

The new implementation:
 - always saves the actual (pending) geometry at first layout change
 - explicitly tracks whether a view has moved between outputs
 - consolidates invalidating the saved geometry into one place, rather
   than having lots of invalidate() calls sprinkled everywhere
This commit is contained in:
John Lindgren 2026-01-11 13:03:23 -05:00 committed by Hiroaki Yamamoto
parent c1c156ef39
commit 20929c0484
3 changed files with 55 additions and 131 deletions

View file

@ -92,9 +92,6 @@ interactive_begin(struct view *view, enum input_mode mode, enum lab_edge edges)
/* Store natural geometry at start of move */
view_store_natural_geometry(view);
if (view_is_floating(view)) {
view_invalidate_last_layout_geometry(view);
}
/* Prevent region snapping when just moving via A-Left mousebind */
seat->region_prevent_snap = keyboard_get_all_modifiers(seat);
@ -111,12 +108,6 @@ interactive_begin(struct view *view, enum input_mode mode, enum lab_edge edges)
return;
}
/*
* Resizing overrides any attempt to restore window
* geometries altered by layout changes.
*/
view_invalidate_last_layout_geometry(view);
/*
* If tiled or maximized in only one direction, reset
* tiled state and un-maximize the relevant axes, but