From 7f37e107af29b105e6c052e178e517ff72a2a14b Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Mon, 19 Feb 2024 23:20:12 +0100 Subject: [PATCH] tree: disallow moving focus to non-toplevel parent --- src/ifs/wl_seat.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifs/wl_seat.rs b/src/ifs/wl_seat.rs index fa8d2ebe..0255895c 100644 --- a/src/ifs/wl_seat.rs +++ b/src/ifs/wl_seat.rs @@ -582,7 +582,9 @@ impl WlSeatGlobal { pub fn focus_parent(self: &Rc) { if let Some(tl) = self.keyboard_node.get().node_toplevel() { if let Some(parent) = tl.tl_data().parent.get() { - self.focus_node(parent.cnode_into_node()); + if let Some(tl) = parent.node_toplevel() { + self.focus_node(tl.tl_into_node()); + } } } }