Merge pull request #3805 from nextcloud/bugfix/fixQmlContextLossEvents

set default format for QSurface to handle NVidia context loss events
This commit is contained in:
Matthieu Gallien 2021-09-22 11:19:15 +02:00 committed by GitHub
commit 71a5e2d477
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,7 @@
#include <QDebug>
#include <QQuickStyle>
#include <QQuickWindow>
#include <QSurfaceFormat>
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")) {