mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-22 19:56:08 +03:00
Merge pull request #1776 from mitchellh/reload-transparency
macos: only set bg color and titlebar color if opaque
This commit is contained in:
@ -173,10 +173,21 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
window.titlebarFont = nil
|
window.titlebarFont = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The titlebar is always updated. We don't need to worry about opacity
|
||||||
|
// because we handle it here.
|
||||||
let backgroundColor = OSColor(ghostty.config.backgroundColor)
|
let backgroundColor = OSColor(ghostty.config.backgroundColor)
|
||||||
window.backgroundColor = backgroundColor
|
|
||||||
window.titlebarColor = backgroundColor.withAlphaComponent(ghostty.config.backgroundOpacity)
|
window.titlebarColor = backgroundColor.withAlphaComponent(ghostty.config.backgroundOpacity)
|
||||||
window.updateTabBar()
|
|
||||||
|
if (window.isOpaque) {
|
||||||
|
// Bg color is only synced if we have no transparency. This is because
|
||||||
|
// the transparency is handled at the surface level (window.backgroundColor
|
||||||
|
// ignores alpha components)
|
||||||
|
window.backgroundColor = backgroundColor
|
||||||
|
|
||||||
|
// If there is transparency, calling this will make the titlebar opaque
|
||||||
|
// so we only call this if we are opaque.
|
||||||
|
window.updateTabBar()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update all surfaces with the focus state. This ensures that libghostty has an accurate view about
|
/// Update all surfaces with the focus state. This ensures that libghostty has an accurate view about
|
||||||
|
Reference in New Issue
Block a user