Skip to content

Commit

Permalink
properly ask Qt to create qml opengl surface with proper options
Browse files Browse the repository at this point in the history
should prevent context losses error with some opengl drivers

should prevent corruptions to occur with come opengl drivers

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed Mar 9, 2022
1 parent 4e5ef72 commit 700319d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")) {
Expand Down

0 comments on commit 700319d

Please sign in to comment.