mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: call occlusion callback for state change
This commit is contained in:
@ -384,6 +384,16 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
self.fixTabBar()
|
self.fixTabBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func windowDidChangeOcclusionState(_ notification: Notification) {
|
||||||
|
guard let surfaceTree = self.surfaceTree else { return }
|
||||||
|
let visible = self.window?.occlusionState.contains(.visible) ?? false
|
||||||
|
for leaf in surfaceTree {
|
||||||
|
if let surface = leaf.surface.surface {
|
||||||
|
ghostty_surface_set_occlusion(surface, visible)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Called when the window will be encoded. We handle the data encoding here in the
|
// Called when the window will be encoded. We handle the data encoding here in the
|
||||||
// window controller.
|
// window controller.
|
||||||
func window(_ window: NSWindow, willEncodeRestorableState state: NSCoder) {
|
func window(_ window: NSWindow, willEncodeRestorableState state: NSCoder) {
|
||||||
|
Reference in New Issue
Block a user