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
@@ -361,6 +361,19 @@ impl Window {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_hittest(&self, hittest: bool) -> Result<(), ExternalError> {
|
||||
let window = self.window.clone();
|
||||
let window_state = Arc::clone(&self.window_state);
|
||||
self.thread_executor.execute_in_thread(move || {
|
||||
WindowState::set_window_flags(window_state.lock(), window.0, |f| {
|
||||
f.set(WindowFlags::IGNORE_CURSOR_EVENT, !hittest)
|
||||
});
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn id(&self) -> WindowId {
|
||||
WindowId(self.hwnd())
|
||||
|
||||
Reference in New Issue
Block a user