focus: Don't send enter/leave for same surface
This commit is contained in:
parent
b4abc06ad8
commit
c06529b548
1 changed files with 18 additions and 0 deletions
|
|
@ -685,6 +685,24 @@ impl KeyboardTarget<State> for KeyboardFocusTarget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fn replace(
|
||||||
|
&self,
|
||||||
|
replaced: <State as smithay::input::SeatHandler>::KeyboardFocus,
|
||||||
|
seat: &Seat<State>,
|
||||||
|
data: &mut State,
|
||||||
|
keys: Vec<KeysymHandle<'_>>,
|
||||||
|
modifiers: ModifiersState,
|
||||||
|
serial: Serial,
|
||||||
|
) {
|
||||||
|
if !replaced
|
||||||
|
.wl_surface()
|
||||||
|
.is_some_and(|s| Some(s) == self.wl_surface())
|
||||||
|
{
|
||||||
|
KeyboardTarget::leave(&replaced, seat, data, serial);
|
||||||
|
KeyboardTarget::enter(self, seat, data, keys, serial);
|
||||||
|
KeyboardTarget::modifiers(self, seat, data, modifiers, serial);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WaylandFocus for KeyboardFocusTarget {
|
impl WaylandFocus for KeyboardFocusTarget {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue