We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
NSWindow::screen
nil
1 parent 1afbfcb commit 4e316c6Copy full SHA for 4e316c6
crates/gpui/src/platform/mac/window.rs
@@ -513,10 +513,11 @@ impl MacWindowState {
513
514
fn bounds(&self) -> Bounds<Pixels> {
515
let mut window_frame = unsafe { NSWindow::frame(self.native_window) };
516
- let screen_frame = unsafe {
517
- let screen = NSWindow::screen(self.native_window);
518
- NSScreen::frame(screen)
519
- };
+ let screen = unsafe { NSWindow::screen(self.native_window) };
+ if screen == nil {
+ return Bounds::new(point(px(0.), px(0.)), crate::DEFAULT_WINDOW_SIZE);
+ }
520
+ let screen_frame = unsafe { NSScreen::frame(screen) };
521
522
// Flip the y coordinate to be top-left origin
523
window_frame.origin.y =
0 commit comments