Merge branch 'imbris/prefer-lock' into 'master'

Prefer locking the cursor when grabbing it (if that option is supported)

See merge request veloren/veloren!4106
This commit is contained in:
Imbris 2023-09-10 21:58:11 +00:00
commit 28dc1dc7b0
No known key found for this signature in database

View File

@ -1034,8 +1034,8 @@ impl Window {
self.window.set_cursor_visible(!grab);
let res = if grab {
self.window
.set_cursor_grab(CursorGrabMode::Confined)
.or_else(|_e| self.window.set_cursor_grab(CursorGrabMode::Locked))
.set_cursor_grab(CursorGrabMode::Locked)
.or_else(|_e| self.window.set_cursor_grab(CursorGrabMode::Confined))
} else {
self.window.set_cursor_grab(CursorGrabMode::None)
};