Skip to content

Commit 373d477

Browse files
Windows Restore Correct Size (#1788)
1 parent 4ac87ee commit 373d477

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

CodeEdit/Features/Documents/WorkspaceDocument.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,16 @@ final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
8989
// SwiftUI also ignores this value, so it just manages to set the initial window size. *Hopefully* this
9090
// is fixed in the future.
9191
// ----
92-
if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String {
93-
window.setContentSize(NSRectFromString(rectString).size)
94-
}
9592
let windowController = CodeEditWindowController(
9693
window: window,
9794
workspace: self,
9895
taskNotificationHandler: taskNotificationHandler
9996
)
10097

10198
if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String {
102-
window.setFrameOrigin(NSRectFromString(rectString).origin)
99+
window.setFrame(NSRectFromString(rectString), display: true, animate: false)
103100
} else {
101+
window.setFrame(NSRect(x: 0, y: 0, width: 1400, height: 900), display: true, animate: false)
104102
window.center()
105103
}
106104
self.addWindowController(windowController)

0 commit comments

Comments
 (0)