MetalHostDisplay: Fix fullscreen in Qt interface

This commit is contained in:
Connor McLaughlin authored and refractionpcsx2 committed 2022-05-05 23:23:48 +01:00
1 parent bec9b34f54
commit af4c047c41
1 file changed
+4 -3
+4 -3
View File
@@ -83,6 +83,9 @@ bool MetalHostDisplay::HasRenderSurface() const { return static_cast<bool>(m_la
void MetalHostDisplay::AttachSurfaceOnMainThread()
{
ASSERT([NSThread isMainThread]);
m_layer = MRCRetain([CAMetalLayer layer]);
[m_layer setDrawableSize:CGSizeMake(m_window_info.surface_width, m_window_info.surface_height)];
[m_layer setDevice:m_dev.dev];
m_view = MRCRetain((__bridge NSView*)m_window_info.window_handle);
[m_view setWantsLayer:YES];
[m_view setLayer:m_layer];
@@ -94,6 +97,7 @@ void MetalHostDisplay::DetachSurfaceOnMainThread()
[m_view setLayer:nullptr];
[m_view setWantsLayer:NO];
m_view = nullptr;
m_layer = nullptr;
}
bool MetalHostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, VsyncMode vsync, bool threaded_presentation, bool debug_device)
@@ -137,9 +141,6 @@ bool MetalHostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view
{
OnMainThread([this]
{
m_layer = MRCRetain([CAMetalLayer layer]);
[m_layer setDrawableSize:CGSizeMake(m_window_info.surface_width, m_window_info.surface_height)];
[m_layer setDevice:m_dev.dev];
AttachSurfaceOnMainThread();
});
SetVSync(vsync);