wayland: handle wl_seat v10 repeated state

Fixes #4382.
This commit is contained in:
Kirill Chibisov 2025-10-17 16:18:11 +09:00
parent c333003514
commit 1e7ab0cd25
2 changed files with 10 additions and 3 deletions

View file

@ -59,6 +59,10 @@ crate = "android-activity"
allow-globs = ["ci/*", "githooks/*"]
crate = "zerocopy"
[[bans.build.bypass]]
allow-globs = ["cherry-pick-stable.sh"]
crate = "libc"
[[bans.build.bypass]]
allow-globs = ["freetype2/*"]
crate = "freetype-sys"

View file

@ -129,20 +129,23 @@ impl Dispatch<WlKeyboard, KeyboardData, WinitState> for WinitState {
state.events_sink.push_window_event(WindowEvent::Focused(false), window_id);
}
},
WlKeyboardEvent::Key { key, state: WEnum::Value(WlKeyState::Pressed), .. } => {
WlKeyboardEvent::Key { key, state: WEnum::Value(key_state), .. }
if matches!(key_state, WlKeyState::Repeated | WlKeyState::Pressed) =>
{
let key = key + 8;
key_input(
keyboard_state,
&mut state.events_sink,
data,
key,
ElementState::Pressed,
false,
key_state == WlKeyState::Repeated,
);
let delay = match keyboard_state.repeat_info {
RepeatInfo::Repeat { delay, .. } => delay,
// When compositor handles repeat, and thus we have `repeat = true`, we have
// repeat on our side disabled, if it's not true, it's a compositor bug.
RepeatInfo::Disable => return,
};