The logic around last_layout_geometry seems unnecessarily complicated.
As far as I can see, it's basically just a copy of the natural_geometry
with some special semantics, specifically:
1. it's copied *from* the natural geometry (or equivalently, the
pending geometry if floating) at the first layout change after a
user-initiated move or resize, and
2. it's copied *back to* the natural geometry at subsequent layout
changes and used as the "original" position to restore.
I don't see the point of the copying back and forth. Unless I'm missing
something, we can achieve the same semantics in a lot less code by just
updating/using the natural_geometry itself at the appropriate times.
The only additional data needed is a single bool to track whether a
layout change has occurred since the last user-initiated move/resize.
No functional change intended, but I may be missing some subtleties as
I found the existing code (and comments) quite difficult to follow.