From 64ec099a9b4490a424d35a4be37c564177e71edf Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 5 Sep 2024 11:13:37 +0200 Subject: Add mouse passthrough tasks to `window` module Co-authored-by: Jose Quesada --- winit/src/program.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'winit/src/program.rs') diff --git a/winit/src/program.rs b/winit/src/program.rs index 89ec5ef9..52d8eb5f 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -1435,6 +1435,16 @@ fn run_action( )); } } + window::Action::EnableMousePassthrough(id) => { + if let Some(window) = window_manager.get_mut(id) { + let _ = window.raw.set_cursor_hittest(false); + } + } + window::Action::DisableMousePassthrough(id) => { + if let Some(window) = window_manager.get_mut(id) { + let _ = window.raw.set_cursor_hittest(true); + } + } }, Action::System(action) => match action { system::Action::QueryInformation(_channel) => { -- cgit