diff --git a/src/shell/focus/mod.rs b/src/shell/focus/mod.rs index 5ebf3a74..2752e3cb 100644 --- a/src/shell/focus/mod.rs +++ b/src/shell/focus/mod.rs @@ -232,7 +232,14 @@ fn raise_with_children(floating_layer: &mut FloatingLayout, focused: &CosmicMapp .0 .toplevel() .and_then(|toplevel| toplevel.parent()); - parent == focused.active_window().wl_surface().map(Cow::into_owned) + parent.is_some_and(|parent| { + focused + .active_window() + .wl_surface() + .map(Cow::into_owned) + .map(|focused| parent == focused) + .unwrap_or(false) + }) }) .cloned() .collect::>()