From ce2f2488d676c822411adb7ac0d1b53c47cd65de Mon Sep 17 00:00:00 2001 From: Khan Winter <35942988+thecoolwinter@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:18:43 -0500 Subject: [PATCH] Windows Restore Correct Size --- CodeEdit/Features/Documents/WorkspaceDocument.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CodeEdit/Features/Documents/WorkspaceDocument.swift b/CodeEdit/Features/Documents/WorkspaceDocument.swift index ee2db55f4..c7edd7bcc 100644 --- a/CodeEdit/Features/Documents/WorkspaceDocument.swift +++ b/CodeEdit/Features/Documents/WorkspaceDocument.swift @@ -89,9 +89,6 @@ final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate { // SwiftUI also ignores this value, so it just manages to set the initial window size. *Hopefully* this // is fixed in the future. // ---- - if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String { - window.setContentSize(NSRectFromString(rectString).size) - } let windowController = CodeEditWindowController( window: window, workspace: self, @@ -99,8 +96,9 @@ final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate { ) if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String { - window.setFrameOrigin(NSRectFromString(rectString).origin) + window.setFrame(NSRectFromString(rectString), display: true, animate: false) } else { + window.setFrame(NSRect(x: 0, y: 0, width: 1400, height: 900), display: true, animate: false) window.center() } self.addWindowController(windowController)