Refine Window::set_cursor_grab API
This commit renames `Window::set_cursor_grab` to `Window::set_cursor_grab_mode`. The new API now accepts enumeration to control the way cursor grab is performed. The value could be: `lock`, `confine`, or `none`. This commit also implements `Window::set_cursor_position` for Wayland, since it's tied to locked cursor. Implements API from #1677.
This commit is contained in:
parent
8ef9fe44c7
commit
9e6f666616
19 changed files with 359 additions and 131 deletions
|
|
@ -20,7 +20,8 @@ use crate::{
|
|||
error,
|
||||
event::{self, VirtualKeyCode},
|
||||
event_loop::{self, ControlFlow},
|
||||
monitor, window,
|
||||
monitor,
|
||||
window::{self, CursorGrabMode},
|
||||
};
|
||||
|
||||
static CONFIG: Lazy<RwLock<Configuration>> = Lazy::new(|| {
|
||||
|
|
@ -765,7 +766,7 @@ impl Window {
|
|||
))
|
||||
}
|
||||
|
||||
pub fn set_cursor_grab(&self, _: bool) -> Result<(), error::ExternalError> {
|
||||
pub fn set_cursor_grab(&self, _: CursorGrabMode) -> Result<(), error::ExternalError> {
|
||||
Err(error::ExternalError::NotSupported(
|
||||
error::NotSupportedError::new(),
|
||||
))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue