mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 09:29:02 +02:00
Fallback to desktop if display plugin fails
This commit is contained in:
parent
931cad34d1
commit
37a725b06d
1 changed files with 11 additions and 1 deletions
|
@ -4892,7 +4892,17 @@ void Application::updateDisplayMode() {
|
||||||
|
|
||||||
// FIXME probably excessive and useless context switching
|
// FIXME probably excessive and useless context switching
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
newDisplayPlugin->activate();
|
|
||||||
|
// If the new plugin fails to activate, fallback to first item on the list
|
||||||
|
if (!newDisplayPlugin->activate()) {
|
||||||
|
qWarning() << "Failed to activate plugin: " << newDisplayPlugin->getName();
|
||||||
|
newDisplayPlugin = displayPlugins.at(0);
|
||||||
|
qWarning() << "Activating fallback plugin: " << newDisplayPlugin->getName();
|
||||||
|
if (!newDisplayPlugin->activate()) {
|
||||||
|
qFatal("Failed to activate fallback plugin");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
offscreenUi->resize(fromGlm(newDisplayPlugin->getRecommendedUiSize()));
|
offscreenUi->resize(fromGlm(newDisplayPlugin->getRecommendedUiSize()));
|
||||||
_offscreenContext->makeCurrent();
|
_offscreenContext->makeCurrent();
|
||||||
|
|
Loading…
Reference in a new issue