GL: fix debug build: creation of QOffscreenSurface sends signals from wrong thread

This commit is contained in:
Megamouse 2024-03-10 20:57:38 +01:00
parent 4cfdb71d3a
commit b176085e14

View file

@ -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();
});