mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-03 00:18:35 +00:00
macos: fix quick terminal issue where closing while fullscreen
This commit is contained in:
@@ -223,7 +223,7 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
visible,
|
visible,
|
||||||
!isHandlingResize else { return }
|
!isHandlingResize else { return }
|
||||||
guard let screen = window.screen ?? NSScreen.main else { return }
|
guard let screen = window.screen ?? NSScreen.main else { return }
|
||||||
|
|
||||||
// Prevent recursive loops
|
// Prevent recursive loops
|
||||||
isHandlingResize = true
|
isHandlingResize = true
|
||||||
defer { isHandlingResize = false }
|
defer { isHandlingResize = false }
|
||||||
@@ -481,6 +481,12 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func animateWindowOut(window: NSWindow, to position: QuickTerminalPosition) {
|
private func animateWindowOut(window: NSWindow, to position: QuickTerminalPosition) {
|
||||||
|
// If we are in fullscreen, then we exit fullscreen. We do this immediately so
|
||||||
|
// we have th correct window.frame for the save state below.
|
||||||
|
if let fullscreenStyle, fullscreenStyle.isFullscreen {
|
||||||
|
fullscreenStyle.exit()
|
||||||
|
}
|
||||||
|
|
||||||
// Save the current window frame before animating out. This preserves
|
// Save the current window frame before animating out. This preserves
|
||||||
// the user's preferred window size and position for when the quick
|
// the user's preferred window size and position for when the quick
|
||||||
// terminal is reactivated with a new surface. Without this, SwiftUI
|
// terminal is reactivated with a new surface. Without this, SwiftUI
|
||||||
@@ -503,11 +509,6 @@ class QuickTerminalController: BaseTerminalController {
|
|||||||
// We always animate out to whatever screen the window is actually on.
|
// We always animate out to whatever screen the window is actually on.
|
||||||
guard let screen = window.screen ?? NSScreen.main else { return }
|
guard let screen = window.screen ?? NSScreen.main else { return }
|
||||||
|
|
||||||
// If we are in fullscreen, then we exit fullscreen.
|
|
||||||
if let fullscreenStyle, fullscreenStyle.isFullscreen {
|
|
||||||
fullscreenStyle.exit()
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we have a previously active application, restore focus to it. We
|
// If we have a previously active application, restore focus to it. We
|
||||||
// do this BEFORE the animation below because when the animation completes
|
// do this BEFORE the animation below because when the animation completes
|
||||||
// macOS will bring forward another window.
|
// macOS will bring forward another window.
|
||||||
|
Reference in New Issue
Block a user