From 69bb35e33615a3f398b87b4136116a59eed85292 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Sat, 2 May 2026 11:14:21 -0700 Subject: [PATCH] floating: don't panic if window disappears mid-unminimize Signed-off-by: SAY-5 --- src/shell/layout/floating/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/shell/layout/floating/mod.rs b/src/shell/layout/floating/mod.rs index f2f475a4..df94fd86 100644 --- a/src/shell/layout/floating/mod.rs +++ b/src/shell/layout/floating/mod.rs @@ -642,7 +642,14 @@ impl FloatingLayout { self.space .map_element(mapped.clone(), position.as_logical(), true); 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( mapped,