From 76c11653522453efcf86f6f2f53bca1a497ea350 Mon Sep 17 00:00:00 2001 From: David Edmundson 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 #include #include +#include +#include +#include #include @@ -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