mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
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.
This commit is contained in:
parent
9e54b97cfa
commit
e108c0de0d
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user