mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-18 01:36:08 +03:00
macos: only modify style mask, don't overwrite
Fixes #784 The issue before was we were removing the fullscreen style which was triggering a Cocoa assertion.
This commit is contained in:
@ -28,13 +28,6 @@ class TerminalController: NSWindowController, NSWindowDelegate, TerminalViewDele
|
|||||||
/// True when an alert is active so we don't overlap multiple.
|
/// True when an alert is active so we don't overlap multiple.
|
||||||
private var alert: NSAlert? = nil
|
private var alert: NSAlert? = nil
|
||||||
|
|
||||||
/// The style mask to use for the new window
|
|
||||||
private var styleMask: NSWindow.StyleMask {
|
|
||||||
var mask: NSWindow.StyleMask = [.resizable, .closable, .miniaturizable]
|
|
||||||
if (ghostty.windowDecorations) { mask.insert(.titled) }
|
|
||||||
return mask
|
|
||||||
}
|
|
||||||
|
|
||||||
init(_ ghostty: Ghostty.AppState, withBaseConfig base: Ghostty.SurfaceConfiguration? = nil) {
|
init(_ ghostty: Ghostty.AppState, withBaseConfig base: Ghostty.SurfaceConfiguration? = nil) {
|
||||||
self.ghostty = ghostty
|
self.ghostty = ghostty
|
||||||
super.init(window: nil)
|
super.init(window: nil)
|
||||||
@ -76,7 +69,9 @@ class TerminalController: NSWindowController, NSWindowDelegate, TerminalViewDele
|
|||||||
|
|
||||||
override func windowDidLoad() {
|
override func windowDidLoad() {
|
||||||
guard let window = window else { return }
|
guard let window = window else { return }
|
||||||
window.styleMask = self.styleMask
|
|
||||||
|
// If window decorations are disabled, remove our title
|
||||||
|
if (!ghostty.windowDecorations) { window.styleMask.remove(.titled) }
|
||||||
|
|
||||||
// Terminals typically operate in sRGB color space and macOS defaults
|
// Terminals typically operate in sRGB color space and macOS defaults
|
||||||
// to "native" which is typically P3. There is a lot more resources
|
// to "native" which is typically P3. There is a lot more resources
|
||||||
|
Reference in New Issue
Block a user