macos: fix quick terminal fullscreen

Fullscreen on quick terminal was failing with a crash, when it tried
to save the state of a non-existent toolbar and its accessory view
controllers.
pull/8093/head
Alexander Lais 2025-07-28 23:05:05 +02:00 committed by Mitchell Hashimoto
parent 830194d436
commit e676eae640
1 changed files with 7 additions and 1 deletions

View File

@ -407,8 +407,14 @@ class NonNativeFullscreen: FullscreenBase, FullscreenStyle {
self.styleMask = window.styleMask self.styleMask = window.styleMask
self.toolbar = window.toolbar self.toolbar = window.toolbar
self.toolbarStyle = window.toolbarStyle self.toolbarStyle = window.toolbarStyle
self.titlebarAccessoryViewControllers = window.titlebarAccessoryViewControllers
self.dock = window.screen?.hasDock ?? false self.dock = window.screen?.hasDock ?? false
self.titlebarAccessoryViewControllers = if (window.hasTitleBar) {
// Accessing titlebarAccessoryViewControllers without a titlebar triggers a crash.
window.titlebarAccessoryViewControllers
} else {
[]
}
if let cgWindowId = window.cgWindowId { if let cgWindowId = window.cgWindowId {
// 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