From 9c2f908d44c0c03ee423249da7d97fc19dadd275 Mon Sep 17 00:00:00 2001 From: warmenhoven Date: Tue, 21 Feb 2023 14:09:21 -0500 Subject: [PATCH] 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. --- gfx/drivers/metal.m | 2 ++ ui/drivers/ui_cocoa.m | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/gfx/drivers/metal.m b/gfx/drivers/metal.m index 5405005c13..591c0c975f 100644 --- a/gfx/drivers/metal.m +++ b/gfx/drivers/metal.m @@ -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; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 907b0d2d83..b397a411a7 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -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]; }