floating: don't panic if window disappears mid-unminimize

Signed-off-by: SAY-5 <say.apm35@gmail.com>
This commit is contained in:
SAY-5 2026-05-02 11:14:21 -07:00 committed by Jacob Kauffmann
parent 836ccbaa0b
commit 69bb35e336

View file

@ -642,7 +642,14 @@ impl FloatingLayout {
self.space self.space
.map_element(mapped.clone(), position.as_logical(), true); .map_element(mapped.clone(), position.as_logical(), true);
self.space.refresh(); self.space.refresh();
let target_geometry = self.space.element_geometry(&mapped).unwrap().as_local(); // The window can disappear between `map_element` and the geometry
// lookup if the client crashes mid-unminimize (race observed in
// pop-os/cosmic-comp#2332). Skip the animation rather than panic —
// the window is already gone, there's nothing to animate.
let Some(target_geometry) = self.space.element_geometry(&mapped) else {
return;
};
let target_geometry = target_geometry.as_local();
self.animations.insert( self.animations.insert(
mapped, mapped,