From f717ae030fe56fc52522ebef69f17f3f09064ac4 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Fri, 5 Jun 2026 08:26:40 +0300 Subject: [PATCH] Add comment to updating kb focus in confirm MRU --- src/niri.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/niri.rs b/src/niri.rs index 609d5f57..3d60544a 100644 --- a/src/niri.rs +++ b/src/niri.rs @@ -993,7 +993,12 @@ impl State { pub fn confirm_mru(&mut self) { if let Some(window) = self.niri.close_mru(MruCloseRequest::Confirm) { + // focus_window() will warp the cursor to the window only when the keyboard focus is on + // the layout. However, right now the keyboard focus is still on the MRU (that we had + // just closed) since it's only updated at the end of the event loop cycle. Force-update + // the keyboard focus here to make cursor warping work. self.update_keyboard_focus(); + self.focus_window(&window); } }