skip cursor lock on android

This commit is contained in:
griffi-gh 2023-05-21 04:24:54 +02:00
parent ec7cddec8d
commit f33d1589b3

View file

@ -9,14 +9,16 @@ pub fn update_cursor_lock_state(
lock: UniqueView<CursorLock>,
display: NonSendSync<UniqueView<Renderer>>
) {
if lock.is_inserted_or_modified() {
let gl_window = display.display.gl_window();
let window = gl_window.window();
window.set_cursor_grab(match lock.0 {
true => CursorGrabMode::Confined,
false => CursorGrabMode::None,
}).expect("Failed to change cursor grab state");
window.set_cursor_visible(!lock.0);
#[cfg(not(target_os = "android"))] {
if lock.is_inserted_or_modified() {
let gl_window = display.display.gl_window();
let window = gl_window.window();
window.set_cursor_grab(match lock.0 {
true => CursorGrabMode::Confined,
false => CursorGrabMode::None,
}).expect("Failed to change cursor grab state");
window.set_cursor_visible(!lock.0);
}
}
}