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:
parent
f6f1c45a72
commit
fc8a008b25
2 changed files with 8 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ Unreleased` header.
|
||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- On Wayland, don't reapply cursor grab when unchanged.
|
||||||
- Move `dpi` types to its own crate, and re-export it from the root crate.
|
- Move `dpi` types to its own crate, and re-export it from the root crate.
|
||||||
- Implement `Sync` for `EventLoopProxy<T: Send>`.
|
- Implement `Sync` for `EventLoopProxy<T: Send>`.
|
||||||
- **Breaking:** Move `Window::new` to `ActiveEventLoop::create_window` and `EventLoop::create_window` (with the latter being deprecated).
|
- **Breaking:** Move `Window::new` to `ActiveEventLoop::create_window` and `EventLoop::create_window` (with the latter being deprecated).
|
||||||
|
|
|
||||||
|
|
@ -826,9 +826,14 @@ impl WindowState {
|
||||||
|
|
||||||
/// Set the cursor grabbing state on the top-level.
|
/// Set the cursor grabbing state on the top-level.
|
||||||
pub fn set_cursor_grab(&mut self, mode: CursorGrabMode) -> Result<(), ExternalError> {
|
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.cursor_grab_mode.user_grab_mode = mode;
|
||||||
self.set_cursor_grab_inner(mode)
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reload the hints for minimum and maximum sizes.
|
/// Reload the hints for minimum and maximum sizes.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue