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
parent
830194d436
commit
e676eae640
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue