Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow AccessKit to react to WindowEvents before they reach the engine #10356

Merged
merged 7 commits into from
Nov 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow AccessKit to filter WindowEvents before they reach the engine.
  • Loading branch information
ndarilek authored and mockersf committed Nov 3, 2023
commit fe2904f84eb894e3a0ce38a864839b5175eda391
12 changes: 12 additions & 0 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,18 @@ pub fn winit_runner(mut app: App) {
return;
};

// Allow AccessKit to filter `WindowEvent`s before they reach
// the engine.
if let Some(adapters) = app.world.get_non_send_resource::<AccessKitAdapters>() {
if let Some(adapter) = adapters.get(&window_entity) {
if let Some(window) = winit_windows.get_window(window_entity) {
if !adapter.on_event(window, &event) {
return;
}
}
}
}

runner_state.window_event_received = true;

match event {
Expand Down