mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -04:00
chore(wayland): don't reapply same cursor grab
Some compositors break when re-taking the same grab. Closes: https://github.com/rust-windowing/winit/issues/3566
This commit is contained in:
@@ -826,9 +826,14 @@ impl WindowState {
|
||||
|
||||
/// Set the cursor grabbing state on the top-level.
|
||||
pub fn set_cursor_grab(&mut self, mode: CursorGrabMode) -> Result<(), ExternalError> {
|
||||
// Replace the user grabbing mode.
|
||||
if self.cursor_grab_mode.user_grab_mode == mode {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.set_cursor_grab_inner(mode)?;
|
||||
// Update user grab on success.
|
||||
self.cursor_grab_mode.user_grab_mode = mode;
|
||||
self.set_cursor_grab_inner(mode)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Reload the hints for minimum and maximum sizes.
|
||||
|
||||
Reference in New Issue
Block a user