From 87a744e1c6f10be9e24049b74c4c8be34528c895 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Wed, 22 May 2024 13:16:54 +0200 Subject: [PATCH] tree: focus floating toplevel after mapping --- src/state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 8246aeb1..0d817293 100644 --- a/src/state.rs +++ b/src/state.rs @@ -621,7 +621,12 @@ impl State { } Rect::new_sized(x1, y1, width, height).unwrap() }; - FloatNode::new(self, workspace, position, node); + FloatNode::new(self, workspace, position, node.clone()); + if node.node_visible() { + if let Some(seat) = self.seat_queue.last() { + node.node_do_focus(&seat, Direction::Unspecified); + } + } } pub fn show_workspace(&self, seat: &Rc, name: &str) {