From 11e7ebd5faed0504108bd009e1e6b74ba98f6121 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 9 Mar 2022 11:44:51 +0100 Subject: [PATCH] properly ask Qt to create qml opengl surface with proper options should prevent context losses error with some opengl drivers should prevent corruptions to occur with come opengl drivers Signed-off-by: Matthieu Gallien --- src/gui/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/main.cpp b/src/gui/main.cpp index bf78b4c07..be74c4447 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -93,6 +93,11 @@ int main(int argc, char **argv) #ifdef Q_OS_MAC Mac::CocoaInitializer cocoaInit; // RIIA #endif + + auto surfaceFormat = QSurfaceFormat::defaultFormat(); + surfaceFormat.setOption(QSurfaceFormat::ResetNotification); + QSurfaceFormat::setDefaultFormat(surfaceFormat); + OCC::Application app(argc, argv); #ifdef Q_OS_WIN @@ -126,10 +131,6 @@ 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