mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +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);
|
_glfwInputWindowDamage(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)makeBackingLayer
|
|
||||||
{
|
|
||||||
if (window->ns.layer)
|
|
||||||
return window->ns.layer;
|
|
||||||
|
|
||||||
return [super makeBackingLayer];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)cursorUpdate:(NSEvent *)event
|
- (void)cursorUpdate:(NSEvent *)event
|
||||||
{
|
{
|
||||||
updateCursorImage(window);
|
updateCursorImage(window);
|
||||||
@ -1737,6 +1729,7 @@ VkResult _glfwPlatformCreateWindowSurface(VkInstance instance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
[window->ns.layer setContentsScale:[window->ns.object backingScaleFactor]];
|
||||||
|
[window->ns.view setLayer:window->ns.layer];
|
||||||
[window->ns.view setWantsLayer:YES];
|
[window->ns.view setWantsLayer:YES];
|
||||||
|
|
||||||
memset(&sci, 0, sizeof(sci));
|
memset(&sci, 0, sizeof(sci));
|
||||||
|
Loading…
Reference in New Issue
Block a user