Skip to content

Commit a74c90f

Browse files
ids1024Drakulix
authored andcommitted
input/actions: Clear keyboard focus moving to output with no window
Fixes #1474.
1 parent 4cf319c commit a74c90f

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/input/actions.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,16 +549,12 @@ impl State {
549549
.map(Into::<KeyboardFocusTarget>::into);
550550
std::mem::drop(shell);
551551

552-
let move_cursor = if let Some(under) = new_target {
553-
let update_cursor = self.common.config.cosmic_conf.cursor_follows_focus;
554-
Shell::set_focus(self, Some(&under), seat, None, update_cursor);
555-
!update_cursor
556-
} else {
557-
true
558-
};
552+
let update_cursor = self.common.config.cosmic_conf.cursor_follows_focus;
553+
Shell::set_focus(self, new_target.as_ref(), seat, None, update_cursor);
559554

560555
if let Some(ptr) = seat.get_pointer() {
561-
if move_cursor {
556+
// Update cursor position if `set_focus` didn't already
557+
if !update_cursor {
562558
ptr.motion(
563559
self,
564560
None,

0 commit comments

Comments
 (0)