input/actions: Clear keyboard focus moving to output with no window
Fixes https://github.com/pop-os/cosmic-comp/issues/1474.
This commit is contained in:
parent
4cf319c09c
commit
a74c90f14f
1 changed files with 4 additions and 8 deletions
|
|
@ -549,16 +549,12 @@ impl State {
|
|||
.map(Into::<KeyboardFocusTarget>::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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue