mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: honor fullscreen setting
This commit is contained in:
@ -67,6 +67,11 @@ class TerminalManager {
|
|||||||
Self.lastCascadePoint = window.cascadeTopLeft(from: Self.lastCascadePoint)
|
Self.lastCascadePoint = window.cascadeTopLeft(from: Self.lastCascadePoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ghostty.windowFullscreen) {
|
||||||
|
// NOTE: this doesn't properly handle non-native fullscreen yet
|
||||||
|
c.window?.toggleFullScreen(nil)
|
||||||
|
}
|
||||||
|
|
||||||
c.showWindow(self)
|
c.showWindow(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,15 @@ extension Ghostty {
|
|||||||
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Whether to open new windows in fullscreen.
|
||||||
|
var windowFullscreen: Bool {
|
||||||
|
guard let config = self.config else { return true }
|
||||||
|
var v = false
|
||||||
|
let key = "fullscreen"
|
||||||
|
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
/// The background opacity.
|
/// The background opacity.
|
||||||
var backgroundOpacity: Double {
|
var backgroundOpacity: Double {
|
||||||
|
@ -281,6 +281,10 @@ command: ?[]const u8 = null,
|
|||||||
/// Start new windows in fullscreen. This setting applies to new
|
/// Start new windows in fullscreen. This setting applies to new
|
||||||
/// windows and does not apply to tabs, splits, etc. However, this
|
/// windows and does not apply to tabs, splits, etc. However, this
|
||||||
/// setting will apply to all new windows, not just the first one.
|
/// setting will apply to all new windows, not just the first one.
|
||||||
|
///
|
||||||
|
/// On macOS, this always creates the window in native fullscreen.
|
||||||
|
/// Non-native fullscreen is not currently supported with this
|
||||||
|
/// setting.
|
||||||
fullscreen: bool = false,
|
fullscreen: bool = false,
|
||||||
|
|
||||||
/// The title Ghostty will use for the window. This will force the title
|
/// The title Ghostty will use for the window. This will force the title
|
||||||
|
Reference in New Issue
Block a user