macos: don't save the native fullscreen window frame

pull/11161/head
Lukas 2026-03-05 15:24:46 +01:00
parent 299a7ad2d4
commit 4ad2bd1112
No known key found for this signature in database
GPG Key ID: 1944A0A77B561220
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ class LastWindowPosition {
// with the wrong one when window decorations change while creating,
// e.g. adding a toolbar affects the window's frame.
guard let window, window.isVisible else { return false }
guard let screenID = window.screen?.displayUUID?.uuidString else {
// We don't save the window frame when the window is in native fullscreen mode,
// since AppKit doesn't restore .fullScreen correctly.
// We should keep the behavior like first-party apps, such as Terminal and Safari.
guard !window.styleMask.contains(.fullScreen), let screenID = window.screen?.displayUUID?.uuidString else {
return false
}
savedWindowRectInfo[screenID] = window.frame