mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 07:03:15 -04:00
Add cursor hittest window functionality (#2232)
Co-authored-by: z4122 <412213484@qq.com> Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
committed by
GitHub
parent
142d55ff24
commit
bf366cb99d
@@ -949,6 +949,19 @@ impl Window {
|
||||
pub fn drag_window(&self) -> Result<(), ExternalError> {
|
||||
self.window.drag_window()
|
||||
}
|
||||
|
||||
/// Modifies whether the window catches cursor events.
|
||||
///
|
||||
/// If `true`, the window will catch the cursor events. If `false`, events are passed through
|
||||
/// the window such that any other window behind it receives them. By default hittest is enabled.
|
||||
///
|
||||
/// ## Platform-specific
|
||||
///
|
||||
/// - **iOS / Android / Web / X11:** Always returns an [`ExternalError::NotSupported`].
|
||||
#[inline]
|
||||
pub fn set_cursor_hittest(&self, hittest: bool) -> Result<(), ExternalError> {
|
||||
self.window.set_cursor_hittest(hittest)
|
||||
}
|
||||
}
|
||||
|
||||
/// Monitor info functions.
|
||||
|
||||
Reference in New Issue
Block a user