Skip to content

Commit

Permalink
Should be let some
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed May 8, 2024
1 parent b4f61c0 commit 3451755
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/tauri-runtime-wry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4212,9 +4212,11 @@ fn get_work_area_size(target_monitor: &MonitorHandle) -> TaoPhysicalSize<u32> {
{
use cocoa::{appkit::NSScreen, base::id};
use tao::platform::windows::MonitorHandleExtMacOS;
let ns_screen: id = target_monitor.ns_screen() as _;
let rect = unsafe { ns_screen.visibleFrame() };
return TaoPhysicalSize::new(rect.size.width as u32, rect.size.height as u32);
if let Some(ns_screen) = target_monitor.ns_screen() {
let ns_screen = ns_screen as id;
let rect = unsafe { ns_screen.visibleFrame() };
return TaoPhysicalSize::new(rect.size.width as u32, rect.size.height as u32);
}
}
target_monitor.size()
}
Expand Down

0 comments on commit 3451755

Please sign in to comment.