@@ -97,7 +97,8 @@ final class DocumentWindowController: NSWindowController, NSWindowDelegate {
97
97
// if multiple window instances have the same name (2024-10, macOS 15).
98
98
self . windowAutosaveName = self . isDirectoryDocument ? " DirectoryDocument " : " Document "
99
99
100
- let window = DocumentWindow ( contentViewController: WindowContentViewController ( document: document, directoryDocument: directoryDocument) )
100
+ let viewController = WindowContentViewController ( document: document, directoryDocument: directoryDocument)
101
+ let window = DocumentWindow ( contentViewController: viewController)
101
102
window. styleMask. update ( with: . fullSizeContentView)
102
103
window. animationBehavior = . documentWindow
103
104
window. setFrameAutosaveName ( self . windowAutosaveName)
@@ -106,14 +107,16 @@ final class DocumentWindowController: NSWindowController, NSWindowDelegate {
106
107
window. tabbingMode = . disallowed
107
108
}
108
109
109
- // set window frame
110
+ // set window size
110
111
let width = UserDefaults . standard [ . windowWidth] ?? 0
111
112
let height = UserDefaults . standard [ . windowHeight] ?? 0
112
113
if width > 0 || height > 0 {
113
114
let frameSize = NSSize ( width: width > window. minSize. width ? width : window. frame. width,
114
115
height: height > window. minSize. height ? height : window. frame. height)
115
116
window. setFrame ( NSRect ( origin: window. frame. origin, size: frameSize) , display: false )
116
117
}
118
+
119
+ // cascade window position
117
120
if let mainWindow = NSApp . mainWindow {
118
121
let frame = if #available( macOS 15 , * ) {
119
122
mainWindow. cascadingReferenceFrame
0 commit comments