From b975355fa267d7c74fe0a3492da6400bcb2c53d2 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 21 Oct 2024 19:07:53 -0400 Subject: [PATCH] fix: filter out events with no window id, if the window id is needed --- winit/src/program.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/winit/src/program.rs b/winit/src/program.rs index ec113677b9..4f2566bdf8 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -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,