mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Use NSWindow’s stringWithSavedFrame instead of window.frame
This includes the screen dimension so that restoring the frame on a different screen can scale the window accordingly.
This commit is contained in:
@@ -2336,7 +2336,11 @@ static NSUInteger DisableSessionSavingCount = 0;
|
||||
DocumentController* controller = [DocumentController new];
|
||||
[controller setupControllerForProject:project skipMissingFiles:NO];
|
||||
if(NSString* windowFrame = project[@"windowFrame"])
|
||||
[controller.window setFrame:NSRectFromString(windowFrame) display:NO];
|
||||
{
|
||||
if([windowFrame hasPrefix:@"{"]) // Legacy NSRect
|
||||
[controller.window setFrame:NSRectFromString(windowFrame) display:NO];
|
||||
else [controller.window setFrameFromString:windowFrame];
|
||||
}
|
||||
[controller showWindow:nil];
|
||||
if([project[@"miniaturized"] boolValue])
|
||||
[controller.window miniaturize:nil];
|
||||
@@ -2407,7 +2411,7 @@ static NSUInteger DisableSessionSavingCount = 0;
|
||||
|
||||
if(([self.window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask)
|
||||
res[@"fullScreen"] = @YES;
|
||||
else res[@"windowFrame"] = NSStringFromRect([self.window frame]);
|
||||
else res[@"windowFrame"] = [self.window stringWithSavedFrame];
|
||||
|
||||
res[@"miniaturized"] = @([self.window isMiniaturized]);
|
||||
res[@"htmlOutputSize"] = NSStringFromSize(self.htmlOutputSize);
|
||||
|
||||
Reference in New Issue
Block a user