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

do not set hit test unconditionally on window creation #7996

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Changes from all commits
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
15 changes: 10 additions & 5 deletions crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,16 @@ impl WinitWindows {
}

winit_window.set_cursor_visible(window.cursor.visible);
if let Err(err) = winit_window.set_cursor_hittest(window.cursor.hit_test) {
warn!(
"Could not set cursor hit test for window {:?}: {:?}",
window.title, err
);

// Do not set the cursor hittest on window creation if it's false, as it will always fail on some
// platforms and log an unfixable warning.
if !window.cursor.hit_test {
if let Err(err) = winit_window.set_cursor_hittest(window.cursor.hit_test) {
warn!(
"Could not set cursor hit test for window {:?}: {:?}",
window.title, err
);
}
}

self.entity_to_winit.insert(entity, winit_window.id());
Expand Down