From db8e74b7a35cf35a38385067379dc4dcf86004fe Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 18 Nov 2024 15:25:43 -0800 Subject: [PATCH] Send `KeyboardEventVariant::Enter` on keyboard enter `cosmic-osd` expected this event, but it wasn't being sent. This isn't hard to fix, unless there's some non-obvious issues that this was commented to avoid (that is still applicable). --- .../wayland/handlers/seat/keyboard.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs b/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs index eafaef9a..f4896f0c 100644 --- a/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs +++ b/winit/src/platform_specific/wayland/handlers/seat/keyboard.rs @@ -20,7 +20,7 @@ impl KeyboardHandler for SctkState { _keysyms: &[Keysym], ) { self.request_redraw(surface); - let (i, mut is_active, _seat) = { + let (i, mut is_active, seat) = { let (i, is_active, my_seat) = match self.seats.iter_mut().enumerate().find_map(|(i, s)| { if s.kbd.as_ref() == Some(keyboard) { @@ -56,11 +56,12 @@ impl KeyboardHandler for SctkState { id, winit::event::WindowEvent::Focused(true), )); - // self.sctk_events.push(SctkEvent::KeyboardEvent { - // variant: KeyboardEventVariant::Enter(surface.clone()), - // kbd_id: keyboard.clone(), - // seat_id: seat, - // }) + self.sctk_events.push(SctkEvent::KeyboardEvent { + variant: KeyboardEventVariant::Enter(surface.clone()), + kbd_id: keyboard.clone(), + seat_id: seat, + surface: surface.clone(), + }); } }