From e108c0de0d531123b560931c07c5a226e7d7a3da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 27 Mar 2019 16:28:16 +0100 Subject: [PATCH] Cocoa: Explicitly set layer on surface creation Implicitly setting the layer doesn't work when there is already a layer. Our view is now layer-hosting for Vulkan. Fixes #1340. --- src/cocoa_window.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 8c4fa4f1..a7d61283 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -400,14 +400,6 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; _glfwInputWindowDamage(window); } -- (id)makeBackingLayer -{ - if (window->ns.layer) - return window->ns.layer; - - return [super makeBackingLayer]; -} - - (void)cursorUpdate:(NSEvent *)event { updateCursorImage(window); @@ -1737,6 +1729,7 @@ VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, } [window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]]; + [window->ns.view setLayer:window->ns.layer]; [window->ns.view setWantsLayer:YES]; memset(&sci, 0, sizeof(sci));