From 654b27823d6b1aa23ca22290cb1d88194cb980d4 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Thu, 7 Feb 2019 13:57:22 -0600 Subject: [PATCH] winemac: Fix failure to render OpenGL on macOS 10.14 (Mojave). For programs linked against the macOS 10.14 SDK, Mojave makes all view hierarchies layer-backed. For views to which OpenGL contexts have been attached this caused a regression where they sometimes failed to render and just remain black. Updating the OpenGL context after the framework has assigned a layer to our view works around the problem. Thanks to Elviss Strazdins on Stack Overflow for the solution . Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- dlls/winemac.drv/cocoa_window.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index e405cda2d24..f43b26b8e32 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -747,6 +747,12 @@ - (void) willRemoveSubview:(NSView*)subview [super willRemoveSubview:subview]; } + - (void) setLayer:(CALayer*)newLayer + { + [super setLayer:newLayer]; + [self updateGLContexts]; + } + /* * ---------- NSTextInputClient methods ---------- */