From b5dcec521505c1486ff91bde3558d99c4f03e5ae Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 6 Jun 2024 13:07:24 +0200 Subject: [PATCH] focus: Don't stack overflow because None=None --- src/shell/focus/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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::>()