Skip to content

Commit

Permalink
Send KeyboardEventVariant::Enter on keyboard enter
Browse files Browse the repository at this point in the history
`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).
  • Loading branch information
ids1024 committed Nov 19, 2024
1 parent 2568635 commit d7b189d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions winit/src/platform_specific/wayland/handlers/seat/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -55,11 +55,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(),
});
}
}

Expand Down

0 comments on commit d7b189d

Please sign in to comment.