From ac28cc1cf5211414b923281289cd06a980ea3db2 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Fri, 17 Sep 2021 09:54:25 +0200 Subject: [PATCH] set default format for QSurface to handle NVidia context loss events should fix wrong OpenGL rendering after suspend on Linux with NVidia binary OpenGL driver close #3759 Signed-off-by: Matthieu Gallien --- src/gui/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index ec4a347eb..ef5747974 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -39,6 +39,7 @@ #include #include #include +#include using namespace OCC; @@ -113,6 +114,10 @@ int main(int argc, char **argv) } #endif + auto surfaceFormat = QSurfaceFormat::defaultFormat(); + surfaceFormat.setOption(QSurfaceFormat::ResetNotification); + QSurfaceFormat::setDefaultFormat(surfaceFormat); + // check a environment variable for core dumps #ifdef Q_OS_UNIX if (!qEnvironmentVariableIsEmpty("OWNCLOUD_CORE_DUMP")) { -- 2.30.2