From a74c90f14fa32e53f7abdaaadf3774b3da86cb19 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Thu, 10 Jul 2025 15:24:50 -0700 Subject: [PATCH] input/actions: Clear keyboard focus moving to output with no window Fixes https://github.com/pop-os/cosmic-comp/issues/1474. --- src/input/actions.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/input/actions.rs b/src/input/actions.rs index 5e6bd67d..90b99653 100644 --- a/src/input/actions.rs +++ b/src/input/actions.rs @@ -549,16 +549,12 @@ impl State { .map(Into::::into); std::mem::drop(shell); - let move_cursor = if let Some(under) = new_target { - let update_cursor = self.common.config.cosmic_conf.cursor_follows_focus; - Shell::set_focus(self, Some(&under), seat, None, update_cursor); - !update_cursor - } else { - true - }; + let update_cursor = self.common.config.cosmic_conf.cursor_follows_focus; + Shell::set_focus(self, new_target.as_ref(), seat, None, update_cursor); if let Some(ptr) = seat.get_pointer() { - if move_cursor { + // Update cursor position if `set_focus` didn't already + if !update_cursor { ptr.motion( self, None,