macos: nuke the titlebar from orbit when hidden

This commit is contained in:
Mitchell Hashimoto
2024-10-24 21:06:32 -07:00
parent 495925355a
commit 67bc9fa0bc
2 changed files with 10 additions and 2 deletions

View File

@ -235,12 +235,12 @@ class BaseTerminalController: NSWindowController,
// Set the main window title
window.title = to
}
func pwdDidChange(to: URL?) {
guard let window else { return }
if ghostty.config.macosTitlebarProxyIcon == .visible {
// Use the 'to' URL directly
window.representedURL = to

View File

@ -310,6 +310,14 @@ class TerminalController: BaseTerminalController {
// Disallow tabbing if the titlebar is hidden, since that will (should) also hide the tab bar.
window.tabbingMode = .disallowed
// Nuke it from orbit -- hide the titlebar container entirely, just in case. There are
// some operations that appear to bring back the titlebar visibility so this ensures
// it is gone forever.
if let themeFrame = window.contentView?.superview,
let titleBarContainer = themeFrame.firstDescendant(withClassName: "NSTitlebarContainerView") {
titleBarContainer.isHidden = true
}
}
// In various situations, macOS automatically tabs new windows. Ghostty handles