mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-03 12:28:13 +08:00
macOS: overrode function syncAppearance in order to update the tab bar as well (#13017)
#12949 I'm unsure about the performance implications of overriding syncAppearance as opposed to other methods(ie setupKVO or setupTabGroupObservation) but I found that this shows the tab group correctly.
This commit is contained in:
@@ -51,6 +51,16 @@ class TitlebarTabsTahoeTerminalWindow: TransparentTitlebarTerminalWindow, NSTool
|
||||
self.toolbar = toolbar
|
||||
toolbarStyle = .unifiedCompact
|
||||
}
|
||||
// Called after new tab finishes adjusting and setupTabBar is called in order to prevent Tab Bar hiding/size bug that occurs with some interactions with Mac UI
|
||||
override func syncAppearance(_ surfaceConfig: Ghostty.SurfaceView.DerivedConfig) {
|
||||
super.syncAppearance(surfaceConfig)
|
||||
DispatchQueue.main.async {
|
||||
// HACK: wait a tick before doing anything, to avoid edge cases during startup... :/
|
||||
// If we don't do this then on launch windows with restored state with tabs will end
|
||||
// up with messed up tab bars that don't show all tabs.
|
||||
self.setupTabBar()
|
||||
}
|
||||
}
|
||||
|
||||
override func becomeMain() {
|
||||
super.becomeMain()
|
||||
|
||||
Reference in New Issue
Block a user