From b176085e14db32de3bdb0cd6e5d96ab456dd9e6d Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 10 Mar 2024 20:57:38 +0100 Subject: [PATCH] GL: fix debug build: creation of QOffscreenSurface sends signals from wrong thread --- rpcs3/rpcs3qt/gl_gs_frame.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpcs3/rpcs3qt/gl_gs_frame.cpp b/rpcs3/rpcs3qt/gl_gs_frame.cpp index 665c2c92ec..01c4aa4259 100644 --- a/rpcs3/rpcs3qt/gl_gs_frame.cpp +++ b/rpcs3/rpcs3qt/gl_gs_frame.cpp @@ -30,11 +30,13 @@ draw_context_t gl_gs_frame::make_context() if (m_primary_context) { - auto surface = new QOffscreenSurface(); - surface->setFormat(m_format); + QOffscreenSurface* surface = nullptr; + // Workaround for the Qt warning: "Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures." Emu.BlockingCallFromMainThread([&]() { + surface = new QOffscreenSurface(); + surface->setFormat(m_format); surface->create(); });