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).
This commit is contained in:
Ian Douglas Scott 2024-11-18 15:25:43 -08:00 committed by Ashley Wulber
parent 83910ff5b0
commit db8e74b7a3
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -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(),
});
}
}