Qt: Force OpenGL paint engine creation thread (fixes #1642)
Vicki Pfau vi@endrift.com
Sat, 25 Jan 2020 15:10:15 -0800
2 files changed,
10 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -11,6 +11,7 @@ - GBA Video: Fix OAM not invalidating after reset (fixes mgba.io/i/1630)
Other fixes: - Qt: Only dynamically reset video scale if a game is running - Qt: Fix race condition with proxied video events + - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) 0.8.0: (2020-01-21) Features:
M
src/platform/qt/DisplayGL.cpp
→
src/platform/qt/DisplayGL.cpp
@@ -271,6 +271,15 @@ #endif
m_gl->makeCurrent(m_surface); m_window = new QOpenGLPaintDevice; + { + // XXX: Qt creates TLS for OpenGL objects in the local thread + // We need to prevent that thread from being the painter thread + // Qt also caches the engine object on the device if a different + // engine is active, so let's make a temporary one + QOpenGLPaintDevice* fakeDevice = new QOpenGLPaintDevice; + QPainter fakePainter(fakeDevice); + m_window->paintEngine(); + } #if defined(_WIN32) && defined(USE_EPOXY) epoxy_handle_external_wglMakeCurrent(); #endif