fix: check if tab is part of the fullscreen group
parent
dd4b966b70
commit
768e94defe
|
|
@ -512,20 +512,23 @@ class BaseTerminalController: NSWindowController,
|
|||
|
||||
// For fullscreen windows with tabs, force a relayout on all tabs.
|
||||
// After a monitor disconnect, the window frames become stale. Cycling
|
||||
// through tabs fixes this, so we simulate that by ordering each window.
|
||||
// through tabs fixes this, so we simulate that by changing the selected tab.
|
||||
if window.styleMask.contains(.fullScreen) {
|
||||
if let tabGroup = window.tabGroup, tabGroup.windows.count > 1 {
|
||||
DispatchQueue.main.async {
|
||||
// Remember the current main window
|
||||
let currentMain = window
|
||||
|
||||
// Briefly make each background tab key to trigger layout recalculation
|
||||
for tabWindow in tabGroup.windows where tabWindow != currentMain {
|
||||
tabWindow.makeKeyAndOrderFront(nil)
|
||||
// Remember the current selected window
|
||||
let originalSelected = tabGroup.selectedWindow
|
||||
|
||||
// Briefly select each tab to trigger layout recalculation
|
||||
// Only cycle through tabs that have the fullscreen style mask
|
||||
for tabWindow in tabGroup.windows where tabWindow != originalSelected && tabWindow.styleMask.contains(.fullScreen) {
|
||||
tabGroup.selectedWindow = tabWindow
|
||||
}
|
||||
|
||||
// Restore the original selection
|
||||
if let originalSelected {
|
||||
tabGroup.selectedWindow = originalSelected
|
||||
}
|
||||
|
||||
// Restore the original window as key
|
||||
currentMain.makeKeyAndOrderFront(nil)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue