mirror of
https://github.com/glfw/glfw.git
synced 2026-09-23 00:59:48 +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:
+1
-8
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user