Use NSScreen to fetch primary display
According to Chromium source, `NSScreen::screens` should always get us one display. We made this change because we ran into panics caused by the previous `unwrap()` when `CGGetActiveDisplayList` might return an empty list.
This commit is contained in:
parent
03bfe3ef80
commit
f938bae0a2
2 changed files with 23 additions and 2 deletions
|
@ -484,7 +484,7 @@ impl MacWindow {
|
|||
|
||||
let display = options
|
||||
.display_id
|
||||
.and_then(|display_id| MacDisplay::all().find(|display| display.id() == display_id))
|
||||
.and_then(MacDisplay::find_by_id)
|
||||
.unwrap_or_else(MacDisplay::primary);
|
||||
|
||||
let mut target_screen = nil;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue