diff --git a/macos/Sources/Features/Terminal/TerminalController.swift b/macos/Sources/Features/Terminal/TerminalController.swift index 080f2d871..f9ab6cfc7 100644 --- a/macos/Sources/Features/Terminal/TerminalController.swift +++ b/macos/Sources/Features/Terminal/TerminalController.swift @@ -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