floating: Restore size of moved maximized windows correctly

This commit is contained in:
Victoria Brekenfeld 2023-10-23 22:15:27 +02:00
parent d6434d322e
commit 5b7efa3a8b
5 changed files with 47 additions and 2 deletions

View file

@ -157,8 +157,15 @@ impl FloatingLayout {
pub fn unmap(&mut self, window: &CosmicMapped) -> bool {
if !window.is_maximized(true) || !window.is_fullscreen(true) {
if let Some(location) = self.space.element_location(window) {
*window.last_geometry.lock().unwrap() =
Some(Rectangle::from_loc_and_size(location, window.geometry().size).as_local());
*window.last_geometry.lock().unwrap() = Some(
Rectangle::from_loc_and_size(
location,
window
.pending_size()
.unwrap_or_else(|| window.geometry().size),
)
.as_local(),
)
}
}