diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-30 20:28:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-30 20:33:41 +0300 |
commit | 0722981e99b0f174067b9d07eeaf7c55401f85eb (patch) | |
tree | f4c5307a4bdd494cc0e1806c265d44aa5e430aee /intern | |
parent | 40f10fe11a962e892388ffd1430d33d46874c35a (diff) |
Fix T56909: wrong interface scale on macOS 10.14, when using 10.14 SDK.
This does not affect existing releases as far as I can tell, only new builds
using the new SDK have the problem.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 22dc772fff0..43695f3f774 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -551,7 +551,15 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( //Creates the OpenGL View inside the window m_openGLView = [[CocoaOpenGLView alloc] initWithFrame:rect]; - + + if (m_systemCocoa->m_nativePixel) { + // Needs to happen early when building with the 10.14 SDK, otherwise + // has no effect until resizeing the window. + if ([m_openGLView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) { + [m_openGLView setWantsBestResolutionOpenGLSurface:YES]; + } + } + [m_openGLView setSystemAndWindowCocoa:systemCocoa windowCocoa:this]; [m_window setContentView:m_openGLView]; @@ -563,14 +571,9 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( updateDrawingContext(); activateDrawingContext(); - // XXX jwilkins: This seems like it belongs in GHOST_ContextCGL, but probably not GHOST_ContextEGL if (m_systemCocoa->m_nativePixel) { - if ([m_openGLView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) { - [m_openGLView setWantsBestResolutionOpenGLSurface:YES]; - - NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]]; - m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width; - } + NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]]; + m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width; } setTitle(title); |