On Windows, fix invalid hmonitor panic
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
parent
41dbbc27a0
commit
52b7205b75
1 changed files with 9 additions and 5 deletions
|
|
@ -209,11 +209,15 @@ impl MonitorHandle {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn position(&self) -> PhysicalPosition<i32> {
|
pub fn position(&self) -> PhysicalPosition<i32> {
|
||||||
let rc_monitor = get_monitor_info(self.0).unwrap().monitorInfo.rcMonitor;
|
get_monitor_info(self.0)
|
||||||
PhysicalPosition {
|
.map(|info| {
|
||||||
x: rc_monitor.left,
|
let rc_monitor = info.monitorInfo.rcMonitor;
|
||||||
y: rc_monitor.top,
|
PhysicalPosition {
|
||||||
}
|
x: rc_monitor.left,
|
||||||
|
y: rc_monitor.top,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.unwrap_or(PhysicalPosition { x: 0, y: 0 })
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue