Change summary
crates/gpui/src/platform/mac/window.rs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Detailed changes
@@ -513,10 +513,11 @@ impl MacWindowState {
fn bounds(&self) -> Bounds<Pixels> {
let mut window_frame = unsafe { NSWindow::frame(self.native_window) };
- let screen_frame = unsafe {
- let screen = NSWindow::screen(self.native_window);
- NSScreen::frame(screen)
- };
+ let screen = unsafe { NSWindow::screen(self.native_window) };
+ if screen == nil {
+ return Bounds::new(point(px(0.), px(0.)), crate::DEFAULT_WINDOW_SIZE);
+ }
+ let screen_frame = unsafe { NSScreen::frame(screen) };
// Flip the y coordinate to be top-left origin
window_frame.origin.y =