From: Matthieu Gallien Date: Wed, 9 Mar 2022 10:44:51 +0000 (+0100) Subject: properly ask Qt to create qml opengl surface with proper options X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~17^2~117^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=11e7ebd5faed0504108bd009e1e6b74ba98f6121;p=nextcloud-desktop.git 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 --- 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")) {