summaryrefslogtreecommitdiff
path: root/x11-misc/sddm/files/sddm-0.18.1-nvidia-glitches-vt-switch.patch
blob: ab2fc18cbcbf9b5c7d3e485d21a02b6f1215c9e3 (plain)
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
43
44
45
46
From 76c11653522453efcf86f6f2f53bca1a497ea350 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Thu, 28 Mar 2019 11:43:37 +0000
Subject: Enable QSurfaceFormat::ResetNotification on new Qt

This fixes graphical glitches on nvidia after VT switching.

It's opt-in as it requires code paths to handle glGetError differently.
The version comparison is because my early implementations missed a code
path. This was fixed in 5.12.2, but we may as well play safe

(cherry picked from commit cd4e1fa21e1ab7178fa5d2ef858f3271575fd315)
---
 src/greeter/GreeterApp.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp
index d47998e..4e117a7 100644
--- a/src/greeter/GreeterApp.cpp
+++ b/src/greeter/GreeterApp.cpp
@@ -40,6 +40,9 @@
 #include <QDebug>
 #include <QTimer>
 #include <QTranslator>
+#include <QLibraryInfo>
+#include <QVersionNumber>
+#include <QSurfaceFormat>
 
 #include <iostream>
 
@@ -309,6 +312,12 @@ int main(int argc, char **argv)
         qDebug() << "High-DPI autoscaling not Enabled";
     }
 
+    if (QLibraryInfo::version() >= QVersionNumber(5, 13, 0)) {
+        auto format(QSurfaceFormat::defaultFormat());
+        format.setOption(QSurfaceFormat::ResetNotification);
+        QSurfaceFormat::setDefaultFormat(format);
+    }
+
     QGuiApplication app(argc, argv);
 
     QCommandLineParser parser;
-- 
2.38.1