forge
Explore
Log in

Don't you dare go Hollow

Add comment to updating kb focus in confirm MRU

Browse files at this commit

f717ae030fe56fc52522ebef69f17f3f09064ac4Ivan MolodetskikhParent: f369608
src/niri.rsmodified+5 -0
@@ -993,7 +993,12 @@ impl State {
993 993
994 pub fn confirm_mru(&mut self) {994 pub fn confirm_mru(&mut self) {
995 if let Some(window) = self.niri.close_mru(MruCloseRequest::Confirm) {995 if let Some(window) = self.niri.close_mru(MruCloseRequest::Confirm) {
996+ // focus_window() will warp the cursor to the window only when the keyboard focus is on
997+ // the layout. However, right now the keyboard focus is still on the MRU (that we had
998+ // just closed) since it's only updated at the end of the event loop cycle. Force-update
999+ // the keyboard focus here to make cursor warping work.
996 self.update_keyboard_focus();1000 self.update_keyboard_focus();
1001+
997 self.focus_window(&window);1002 self.focus_window(&window);
998 }1003 }
999 }1004 }