Skip to content

Commit

Permalink
fix(windows): fix monitor from_point retunring invalid handle (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Sep 2, 2024
1 parent 22bd57c commit 431887c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-monitor-from-point-handle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

On Windows, fix `Window::monitor_from_point` and `EventLoopTargetWindow::monitor_from_point` returning invalid monitor handle.
2 changes: 1 addition & 1 deletion src/platform_impl/windows/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn from_point(x: f64, y: f64) -> Option<MonitorHandle> {
MONITOR_DEFAULTTONULL,
)
};
if hmonitor.is_invalid() {
if !hmonitor.is_invalid() {
Some(MonitorHandle::new(hmonitor))
} else {
None
Expand Down

0 comments on commit 431887c

Please sign in to comment.