From 176f5593606b85c1774391022e2211b36d36e467 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Tue, 7 May 2024 19:39:06 -0500 Subject: [PATCH] Set keyboard focus on open only if on active tag --- src/handlers.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/handlers.rs b/src/handlers.rs index 9630148..b0eafa2 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -196,11 +196,13 @@ impl CompositorHandler for State { // the extra configure in that causes windows to map then resize self.pinnacle.loop_handle.insert_idle(move |state| { if let Some(keyboard) = state.pinnacle.seat.get_keyboard() { - keyboard.set_focus( - state, - Some(KeyboardFocusTarget::Window(new_window)), - SERIAL_COUNTER.next_serial(), - ) + if new_window.is_on_active_tag() { + keyboard.set_focus( + state, + Some(KeyboardFocusTarget::Window(new_window)), + SERIAL_COUNTER.next_serial(), + ); + } } }); }