diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c6a0bce2f5..abcc82d1c3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3362,13 +3362,31 @@ void Application::loadSettings() { // If there is a preferred plugin, we probably messed it up with the menu settings, so fix it. auto pluginManager = PluginManager::getInstance(); auto plugins = pluginManager->getPreferredDisplayPlugins(); - for (auto plugin : plugins) { - auto menu = Menu::getInstance(); - if (auto action = menu->getActionForOption(plugin->getName())) { - action->setChecked(true); - action->trigger(); - // Find and activated highest priority plugin, bail for the rest - break; + auto menu = Menu::getInstance(); + if (plugins.size() > 0) { + for (auto plugin : plugins) { + if (auto action = menu->getActionForOption(plugin->getName())) { + action->setChecked(true); + action->trigger(); + // Find and activated highest priority plugin, bail for the rest + break; + } + } + } else { + // If this is our first run, and no preferred devices were set, default to + // an HMD device if available. + Setting::Handle firstRun { Settings::firstRun, true }; + if (firstRun.get()) { + auto displayPlugins = pluginManager->getDisplayPlugins(); + for (auto& plugin : displayPlugins) { + if (plugin->isHmd()) { + if (auto action = menu->getActionForOption(plugin->getName())) { + action->setChecked(true); + action->trigger(); + break; + } + } + } } }