mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macOS: don't crash when opening non-native fullsreen at launch
When we launch ghostty with `fullscreen = true` and `macos-non-native-fullscreen = true` there's no window to check CGSSpaces for. Fixes #7114
This commit is contained in:
@ -355,6 +355,7 @@ class NonNativeFullscreen: FullscreenBase, FullscreenStyle {
|
|||||||
self.styleMask = window.styleMask
|
self.styleMask = window.styleMask
|
||||||
self.dock = window.screen?.hasDock ?? false
|
self.dock = window.screen?.hasDock ?? false
|
||||||
|
|
||||||
|
if (window.isVisible) {
|
||||||
// We hide the menu only if this window is not on any fullscreen
|
// We hide the menu only if this window is not on any fullscreen
|
||||||
// spaces. We do this because fullscreen spaces already hide the
|
// spaces. We do this because fullscreen spaces already hide the
|
||||||
// menu and if we insert/remove this presentation option we get
|
// menu and if we insert/remove this presentation option we get
|
||||||
@ -366,6 +367,12 @@ class NonNativeFullscreen: FullscreenBase, FullscreenStyle {
|
|||||||
} else {
|
} else {
|
||||||
self.menu = spaces.allSatisfy { $0.type != .fullscreen }
|
self.menu = spaces.allSatisfy { $0.type != .fullscreen }
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// When window is not visible at the moment of toggling non-native
|
||||||
|
// fullscreen it means it is launched with `fullscreen = true` and
|
||||||
|
// we want to hide menu in this case.
|
||||||
|
self.menu = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user