Add cursor grab for web target (#2025)
* Add cursor grab
* Update feature matrix, changelog and platform information
* Add proper error propagation
* Remove "expect" from fallible code
code would crash if handling pointer capture outside of winit on
every mouse click
we swallow the error since we could not think of a case where this
would fail in a way that would want to handle that it fails
* Remove unnecessary implementation comment
Co-authored-by: Will Crichton <wcrichto@cs.stanford.edu>
This commit is contained in:
parent
25ff30ee8c
commit
c5c99d2357
6 changed files with 27 additions and 7 deletions
|
|
@ -207,8 +207,11 @@ impl Window {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_grab(&self, _grab: bool) -> Result<(), ExternalError> {
|
||||
Err(ExternalError::NotSupported(NotSupportedError::new()))
|
||||
pub fn set_cursor_grab(&self, grab: bool) -> Result<(), ExternalError> {
|
||||
self.canvas
|
||||
.borrow()
|
||||
.set_cursor_grab(grab)
|
||||
.map_err(|e| ExternalError::Os(e))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue