[Bf-blender-cvs] [786870e26f8] master: Fix T56909: wrong interface scale on macOS 10.14, when using 10.14 SDK.
Brecht Van Lommel
noreply at git.blender.org
Mon Oct 1 08:36:20 CEST 2018
Commit: 786870e26f83ec68f80ccd1fb5ba519a0bf893f6
Author: Brecht Van Lommel
Date: Sun Sep 30 19:28:15 2018 +0200
Branches: master
https://developer.blender.org/rB786870e26f83ec68f80ccd1fb5ba519a0bf893f6
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.
===================================================================
M intern/ghost/intern/GHOST_WindowCocoa.mm
===================================================================
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 20060ac1267..79d2f304e60 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);
More information about the Bf-blender-cvs
mailing list