focus: Don't stack overflow because None=None

This commit is contained in:
Victoria Brekenfeld 2024-06-06 13:07:24 +02:00
parent 697ec9e1fe
commit b5dcec5215

View file

@ -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::<Vec<_>>()