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.
diff --git a/src/cocoa_window.m b/src/cocoa_window.m
index 8c4fa4f..a7d6128 100644
--- a/src/cocoa_window.m
+++ b/src/cocoa_window.m
@@ -400,14 +400,6 @@
_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 @@
}
[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));