From d04a06e757a17807bb51203f62aa24690d13fedc Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Tue, 9 Jul 2019 09:33:44 -0700 Subject: [PATCH 1/6] changing the default fallback to non hmd device --- interface/src/Application.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f8dadcbc22..c8d86c1472 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5409,9 +5409,10 @@ void Application::loadSettings() { 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 auto displayPlugins = pluginManager->getDisplayPlugins(); for (auto& plugin : displayPlugins) { - if (plugin->isHmd()) { + if (!plugin->isHmd()) { if (auto action = menu->getActionForOption(plugin->getName())) { action->setChecked(true); action->trigger(); @@ -8891,7 +8892,7 @@ void Application::updateDisplayMode() { // Menu might have been removed if the display plugin lost if (!action) { continue; - } + } //STOPPED HERE>>>>> HOW DO WE FIND OUT HOW THE ACTION->isChecked is set if (action->isChecked()) { newDisplayPlugin = displayPlugin; break; From 45b339a6c7c9a10ecb9d9ee9e48523b5f626ef46 Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Tue, 9 Jul 2019 09:35:58 -0700 Subject: [PATCH 2/6] removing comment --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c8d86c1472..4b5392215a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -8892,7 +8892,7 @@ void Application::updateDisplayMode() { // Menu might have been removed if the display plugin lost if (!action) { continue; - } //STOPPED HERE>>>>> HOW DO WE FIND OUT HOW THE ACTION->isChecked is set + } if (action->isChecked()) { newDisplayPlugin = displayPlugin; break; From 09ecb49e5b12afaa614bd423c5d68b12d0943edc Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Tue, 9 Jul 2019 11:39:42 -0700 Subject: [PATCH 3/6] --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); + } } } From fc21f6088a1fe7f0c661f4d7587b1a758f463d2a Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Wed, 10 Jul 2019 14:07:10 -0700 Subject: [PATCH 4/6] undoing code structures changes to else blocks --- interface/src/Application.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index a502cd7ba4..add73ee9c5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5418,8 +5418,7 @@ void Application::loadSettings() { } } isFirstPerson = (qApp->isHMDMode()); - } - else { + } else { if (_firstRun.get()) { // If this is our first run, and no preferred devices were set, default to // an HMD device if available. @@ -5434,15 +5433,13 @@ void Application::loadSettings() { } } isFirstPerson = (qApp->isHMDMode()); - } - else { + } 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 { + } else { // if HMD is not active, only use first person if the menu option is checked isFirstPerson = menu->isOptionChecked(MenuOption::FirstPerson); } From bc51b8e7098541e1c1927ee4fb24da908819b12b Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Wed, 10 Jul 2019 14:08:20 -0700 Subject: [PATCH 5/6] removed extra space --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index add73ee9c5..9199cc0aae 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -8903,7 +8903,7 @@ void Application::updateDisplayMode() { // Menu might have been removed if the display plugin lost if (!action) { continue; - } + } if (action->isChecked()) { newDisplayPlugin = displayPlugin; break; From e463a828effe44c676701fbe1ed6bb2d41af58f7 Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Wed, 10 Jul 2019 14:09:51 -0700 Subject: [PATCH 6/6] removed extra line --- interface/src/Application.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 9199cc0aae..ef35987966 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5435,7 +5435,6 @@ void Application::loadSettings() { isFirstPerson = (qApp->isHMDMode()); } 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);