From c3a9355279ef2896f109944d534e507e0eb32fae Mon Sep 17 00:00:00 2001 From: Arnold Loubriat Date: Mon, 25 Dec 2023 19:01:05 +0100 Subject: [PATCH] Fix: Let `accesskit` process window events (#3733) Since accesskit_winit version 0.15.0, it is necessary to call `Adapter::process_events` to let AccessKit fire up window focus events on Unix and macOS. Furthermore this has always been needed on Unix (X11 only) to let AccessKit know about the window bounds, which is needed to perform hit-testing on nodes. --- crates/egui-winit/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/egui-winit/src/lib.rs b/crates/egui-winit/src/lib.rs index da4d2bc4..73a87eb5 100644 --- a/crates/egui-winit/src/lib.rs +++ b/crates/egui-winit/src/lib.rs @@ -236,6 +236,11 @@ impl State { ) -> EventResponse { crate::profile_function!(short_window_event_description(event)); + #[cfg(feature = "accesskit")] + if let Some(accesskit) = &self.accesskit { + accesskit.process_event(window, event); + } + use winit::event::WindowEvent; match event { WindowEvent::ScaleFactorChanged { scale_factor, .. } => {