From 09ecb49e5b12afaa614bd423c5d68b12d0943edc Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Tue, 9 Jul 2019 11:39:42 -0700 Subject: [PATCH] --no-launcher is the launcher override for interface. if app is launched with the args, the first run is bypassed and default display device will always be desktop. not hmd --- interface/src/Application.cpp | 42 +++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4b5392215a..a502cd7ba4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5406,10 +5406,7 @@ void Application::loadSettings() { } bool isFirstPerson = false; - if (_firstRun.get()) { - // If this is our first run, and no preferred devices were set, default to - // an HMD device if available. - // Based on feedback changing to non hmd device as default if not prefered + if (arguments().contains("--no-launcher")) { auto displayPlugins = pluginManager->getDisplayPlugins(); for (auto& plugin : displayPlugins) { if (!plugin->isHmd()) { @@ -5420,18 +5417,35 @@ void Application::loadSettings() { } } } - isFirstPerson = (qApp->isHMDMode()); + } + else { + if (_firstRun.get()) { + // If this is our first run, and no preferred devices were set, default to + // an HMD device if available. + auto displayPlugins = pluginManager->getDisplayPlugins(); + for (auto& plugin : displayPlugins) { + if (plugin->isHmd()) { + if (auto action = menu->getActionForOption(plugin->getName())) { + action->setChecked(true); + action->trigger(); + break; + } + } + } + isFirstPerson = (qApp->isHMDMode()); + } + else { + // if this is not the first run, the camera will be initialized differently depending on user settings - } else { - // if this is not the first run, the camera will be initialized differently depending on user settings - - if (qApp->isHMDMode()) { - // if the HMD is active, use first-person camera, unless the appropriate setting is checked - isFirstPerson = menu->isOptionChecked(MenuOption::FirstPersonHMD); - } else { - // if HMD is not active, only use first person if the menu option is checked - isFirstPerson = menu->isOptionChecked(MenuOption::FirstPerson); + if (qApp->isHMDMode()) { + // if the HMD is active, use first-person camera, unless the appropriate setting is checked + isFirstPerson = menu->isOptionChecked(MenuOption::FirstPersonHMD); + } + else { + // if HMD is not active, only use first person if the menu option is checked + isFirstPerson = menu->isOptionChecked(MenuOption::FirstPerson); + } } }