summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/plasma-integration/52bd3c9c.patch
blob: 4a011266344e5c041b1c6111cbef91d97f17ca10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 52bd3c9cc2a78e2ba8d87e09e01706d309720a6f Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
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<const char *>(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