diff --git a/.changes/fix-monitor-from-point-handle.md b/.changes/fix-monitor-from-point-handle.md new file mode 100644 index 000000000..d65054728 --- /dev/null +++ b/.changes/fix-monitor-from-point-handle.md @@ -0,0 +1,5 @@ +--- +"tao": patch +--- + +On Windows, fix `Window::monitor_from_point` and `EventLoopTargetWindow::monitor_from_point` returning invalid monitor handle. diff --git a/src/platform_impl/windows/monitor.rs b/src/platform_impl/windows/monitor.rs index 0c2e7e334..7a7eef86a 100644 --- a/src/platform_impl/windows/monitor.rs +++ b/src/platform_impl/windows/monitor.rs @@ -133,7 +133,7 @@ pub fn from_point(x: f64, y: f64) -> Option { MONITOR_DEFAULTTONULL, ) }; - if hmonitor.is_invalid() { + if !hmonitor.is_invalid() { Some(MonitorHandle::new(hmonitor)) } else { None