From 83de8ae5a0a0fe7972aaaeb2cdadd1fdcb7df186 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Mar 2019 14:43:27 +0200 Subject: [PATCH] - fixed white flash on startup with Metal-based view --- src/posix/cocoa/i_video.mm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index b1334778f..2d0bb1113 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -237,11 +237,6 @@ namespace m_cursor = cursor; } --(BOOL) wantsUpdateLayer -{ - return YES; -} - +(Class) layerClass { return NSClassFromString(@"CAMetalLayer"); @@ -365,7 +360,8 @@ public: const NSRect contentRect = [ms_window contentRectForFrameRect:[ms_window frame]]; NSView* vulkanView = [[VulkanCocoaView alloc] initWithFrame:contentRect]; - [vulkanView setWantsLayer:YES]; + vulkanView.wantsLayer = YES; + vulkanView.layer.backgroundColor = NSColor.blackColor.CGColor; [ms_window setContentView:vulkanView]; }