From f33d1589b349d2b6edd201053ed6cbfdce499935 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Sun, 21 May 2023 04:24:54 +0200 Subject: [PATCH] skip cursor lock on android --- kubi/src/cursor_lock.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/kubi/src/cursor_lock.rs b/kubi/src/cursor_lock.rs index 6512017..d981262 100644 --- a/kubi/src/cursor_lock.rs +++ b/kubi/src/cursor_lock.rs @@ -9,14 +9,16 @@ pub fn update_cursor_lock_state( lock: UniqueView, display: NonSendSync> ) { - 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); + } } }