diff --git a/src/shell/focus/target.rs b/src/shell/focus/target.rs index 7f02531f..f4ea9884 100644 --- a/src/shell/focus/target.rs +++ b/src/shell/focus/target.rs @@ -494,7 +494,7 @@ impl KeyboardTarget for KeyboardFocusTarget { } fn replace( &self, - replaced: ::KeyboardFocus, + replaced: Self, seat: &Seat, data: &mut State, keys: Vec>, @@ -504,6 +504,9 @@ impl KeyboardTarget for KeyboardFocusTarget { if !replaced .wl_surface() .is_some_and(|s| Some(s) == self.wl_surface()) + && !replaced + .x11_surface() + .is_some_and(|s| Some(s) == self.x11_surface()) { KeyboardTarget::leave(&replaced, seat, data, serial); KeyboardTarget::enter(self, seat, data, keys, serial);