mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-12-26 05:38:20 -06:00
skip cursor lock on android
This commit is contained in:
parent
ec7cddec8d
commit
f33d1589b3
|
@ -9,14 +9,16 @@ pub fn update_cursor_lock_state(
|
||||||
lock: UniqueView<CursorLock>,
|
lock: UniqueView<CursorLock>,
|
||||||
display: NonSendSync<UniqueView<Renderer>>
|
display: NonSendSync<UniqueView<Renderer>>
|
||||||
) {
|
) {
|
||||||
if lock.is_inserted_or_modified() {
|
#[cfg(not(target_os = "android"))] {
|
||||||
let gl_window = display.display.gl_window();
|
if lock.is_inserted_or_modified() {
|
||||||
let window = gl_window.window();
|
let gl_window = display.display.gl_window();
|
||||||
window.set_cursor_grab(match lock.0 {
|
let window = gl_window.window();
|
||||||
true => CursorGrabMode::Confined,
|
window.set_cursor_grab(match lock.0 {
|
||||||
false => CursorGrabMode::None,
|
true => CursorGrabMode::Confined,
|
||||||
}).expect("Failed to change cursor grab state");
|
false => CursorGrabMode::None,
|
||||||
window.set_cursor_visible(!lock.0);
|
}).expect("Failed to change cursor grab state");
|
||||||
|
window.set_cursor_visible(!lock.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue