do not set hit test unconditionally on window creation (#7996)

This commit is contained in:
François 2023-03-13 16:31:13 +01:00 committed by GitHub
parent 6bfc09f53e
commit 71b1b35757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());