Skip to content

Commit

Permalink
fix: filter out events with no window id, if the window id is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 authored and jackpot51 committed Oct 21, 2024
1 parent 894faf6 commit b975355
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,16 @@ async fn run_instance<'a, P, C>(
}

for (id, event) in events.drain(..) {
if id.is_none()
&& matches!(
event,
core::Event::Keyboard(_)
| core::Event::Touch(_)
| core::Event::Mouse(_)
)
{
continue;
}
runtime.broadcast(subscription::Event::Interaction {
window: id.unwrap_or(window::Id::NONE),
event,
Expand Down

0 comments on commit b975355

Please sign in to comment.