From 1898f0d7385f9b25bf77052b7df314646570990a Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 24 Oct 2019 20:44:53 +0200 Subject: [PATCH] [macos] Improve and fix the fix for only quarter of screen rendered in windowed mode and certain fullscreen resolutions on macOS 10.15 (Catalina). --- xbmc/windowing/osx/WinSystemOSX.mm | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm index 9e63dd9320fce..8797608b67bcb 100644 --- a/xbmc/windowing/osx/WinSystemOSX.mm +++ b/xbmc/windowing/osx/WinSystemOSX.mm @@ -784,14 +784,7 @@ static void DisplayReconfigured(CGDirectDisplayID display, if (!view) return false; - if (CDisplaySettings::GetInstance().GetCurrentResolution() == RES_WINDOW) - { - // It seems, that in macOS 10.15 this defaults to YES, but we currently do not support - // Retina resolutions properly. Ensure that the view created by SDL uses a 1 pixel per - // point framebuffer. - view.wantsBestResolutionOpenGLSurface = NO; - } - else + if (CDisplaySettings::GetInstance().GetCurrentResolution() != RES_WINDOW) { // If we are not starting up windowed, then hide the initial SDL window // so we do not see it flash before the fade-out and switch to fullscreen. @@ -875,6 +868,14 @@ static void DisplayReconfigured(CGDirectDisplayID display, NSWindow* window; view = [context view]; + + if (view) + { + // It seems, that in macOS 10.15 this defaults to YES, but we currently do not support + // Retina resolutions properly. Ensure that the view uses a 1 pixel per point framebuffer. + view.wantsBestResolutionOpenGLSurface = NO; + } + if (view && (newWidth > 0) && (newHeight > 0)) { window = [view window]; @@ -1017,10 +1018,6 @@ static void DisplayReconfigured(CGDirectDisplayID display, [windowedFullScreenwindow update]; [blankView setFrameSize:NSMakeSize(m_nWidth, m_nHeight)]; - // It seems, that in macOS 10.15 this defaults to YES, but we currently do not support - // Retina resolutions properly. Thus, ensure that we get a 1 pixel per point framebuffer. - blankView.wantsBestResolutionOpenGLSurface = NO; - // Obtain windowed pixel format and create a new context. newContext = (NSOpenGLContext*)CreateWindowedContext((void* )cur_context); [newContext setView:blankView];