mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
fix(macOS): Improve updating of transparent titlebar tabs backgrounds
FAR from a perfect fix, as the background seen through the tabs during window drags will be behind by a frame or so still, but definitely a vast improvement over not updating at all.
This commit is contained in:
@ -140,6 +140,18 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
||||
}
|
||||
}
|
||||
|
||||
func fixTabBar() {
|
||||
// We do this to make sure that the tab bar will always re-composite. If we don't,
|
||||
// then the it will "drag" pieces of the background with it when a transparent
|
||||
// window is moved around.
|
||||
//
|
||||
// There might be a better way to make the tab bar "un-lazy", but I can't find it.
|
||||
if let window = window, !window.isOpaque {
|
||||
window.isOpaque = true
|
||||
window.isOpaque = false
|
||||
}
|
||||
}
|
||||
|
||||
@objc private func onFrameDidChange(_ notification: NSNotification) {
|
||||
// This is a huge hack to set the proper shortcut for tab selection
|
||||
// on tab reordering using the mouse. There is no event, delegate, etc.
|
||||
@ -335,6 +347,11 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
||||
|
||||
func windowDidBecomeKey(_ notification: Notification) {
|
||||
self.relabelTabs()
|
||||
self.fixTabBar()
|
||||
}
|
||||
|
||||
func windowDidMove(_ notification: Notification) {
|
||||
self.fixTabBar()
|
||||
}
|
||||
|
||||
// Called when the window will be encoded. We handle the data encoding here in the
|
||||
|
Reference in New Issue
Block a user