mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-17 17:26:09 +03:00
Merge pull request #1424 from qwerasd205/fix-titlebar-tab-restore
fix(macOS): restoring tabbed windows with titlebar tabs enabled
This commit is contained in:
@ -208,8 +208,19 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
// Set the background color of the window
|
// Set the background color of the window
|
||||||
window.backgroundColor = NSColor(ghostty.config.backgroundColor)
|
window.backgroundColor = NSColor(ghostty.config.backgroundColor)
|
||||||
|
|
||||||
// Handle titlebar tabs config option
|
// Handle titlebar tabs config option. Something about what we do while setting up the
|
||||||
window.titlebarTabs = ghostty.config.macosTitlebarTabs
|
// titlebar tabs interferes with the window restore process unless window.tabbingMode
|
||||||
|
// is set to .preferred, so we set it, and switch back to automatic as soon as we can.
|
||||||
|
if (ghostty.config.macosTitlebarTabs) {
|
||||||
|
window.tabbingMode = .preferred
|
||||||
|
window.titlebarTabs = true
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
window.tabbingMode = .automatic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set a custom background on the titlebar - this is required for when
|
||||||
|
// titlebar tabs is used in conjunction with a transparent background.
|
||||||
window.setTitlebarBackground(
|
window.setTitlebarBackground(
|
||||||
window
|
window
|
||||||
.backgroundColor
|
.backgroundColor
|
||||||
|
Reference in New Issue
Block a user