Fix initial blurriness on Metal (#15002)

This reverts #14963 and part of #14942. Instead of forcing a size
change on mac the way we do on tvos, bring back the old way of making
two setContentSize calls.
This commit is contained in:
warmenhoven 2023-02-21 14:09:21 -05:00 committed by GitHub
parent 51894c3cbb
commit 9c2f908d44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -174,7 +174,9 @@
[apple_platform setVideoMode:mode];
#ifdef HAVE_COCOATOUCH
[self mtkView:view drawableSizeWillChange:CGSizeMake(mode.width, mode.height)];
#endif
*input = NULL;
*inputData = NULL;

View File

@ -701,6 +701,10 @@ static ui_application_t ui_application_cocoa = {
[self updateWindowedMode];
}
/* HACK(sgc): ensure MTKView posts a drawable resize event */
if (mode.width > 0)
[self.window setContentSize:NSMakeSize(mode.width-1, mode.height)];
[self.window setContentSize:NSMakeSize(mode.width, mode.height)];
[self.window displayIfNeeded];
}