From 52bd3c9cc2a78e2ba8d87e09e01706d309720a6f Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 13 Sep 2022 11:41:03 +0300 Subject: [PATCH] Bring back workaround for threaded render loop not working on NVIDIA Wayland For more details, check QTBUG-95817. But to summarize it in a couple of words: a window will stop pushing buffers when it's resized and using threaded render loop. CCBUG: 455575 --- src/platformtheme/qtquickrenderersettings.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/platformtheme/qtquickrenderersettings.cpp b/src/platformtheme/qtquickrenderersettings.cpp index db7ecb5..fa99d5c 100644 --- a/src/platformtheme/qtquickrenderersettings.cpp +++ b/src/platformtheme/qtquickrenderersettings.cpp @@ -69,6 +69,19 @@ void initializeRendererSessions() if (!qEnvironmentVariableIsSet("QSG_RENDER_LOOP")) { if (!s.renderLoop().isEmpty()) { qputenv("QSG_RENDER_LOOP", s.renderLoop().toLatin1()); + } else if (QGuiApplication::platformName() == QLatin1String("wayland")) { +#if QT_CONFIG(opengl) + // Workaround for Bug 432062 / QTBUG-95817 + QOffscreenSurface surface; + surface.create(); + if (checkContext.makeCurrent(&surface)) { + const char *vendor = reinterpret_cast(checkContext.functions()->glGetString(GL_VENDOR)); + if (qstrcmp(vendor, "NVIDIA Corporation") == 0) { + // Otherwise Qt Quick Windows break when resized + qputenv("QSG_RENDER_LOOP", "basic"); + } + } +#endif } } } -- GitLab