From 175a71590aade9e6662cc2196e3628f62f012449 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/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/winit/src/lib.rs b/winit/src/lib.rs index c1366fa5..654c0f01 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -1347,6 +1347,16 @@ async fn run_instance

( } 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,