mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
Merge pull request #2414 from ghostty-org/push-yzvnksxnotwm
macos: quick terminal window blur settings take effect properly
This commit is contained in:
@ -253,6 +253,16 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
private func syncAppearance() {
|
private func syncAppearance() {
|
||||||
guard let window else { return }
|
guard let window else { return }
|
||||||
|
|
||||||
|
// If our window is not visible, then delay this. This is possible specifically
|
||||||
|
// during state restoration but probably in other scenarios as well. To delay,
|
||||||
|
// we just loop directly on the dispatch queue. We have to delay because some
|
||||||
|
// APIs such as window blur have no effect unless the window is visible.
|
||||||
|
guard window.isVisible else {
|
||||||
|
// Weak window so that if the window changes or is destroyed we aren't holding a ref
|
||||||
|
DispatchQueue.main.async { [weak self] in self?.syncAppearance() }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// If we have window transparency then set it transparent. Otherwise set it opaque.
|
// If we have window transparency then set it transparent. Otherwise set it opaque.
|
||||||
if (ghostty.config.backgroundOpacity < 1) {
|
if (ghostty.config.backgroundOpacity < 1) {
|
||||||
window.isOpaque = false
|
window.isOpaque = false
|
||||||
|
Reference in New Issue
Block a user