Merge pull request #15703 from amerhifi/master

case : BUGZ 560: disabling dde initialization due to random crashes while closing down…
This commit is contained in:
Shannon Romano 2019-06-07 15:15:46 -07:00 committed by GitHub
commit e4b26656d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 10 deletions

View file

@ -867,7 +867,11 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) {
DependencyManager::set<ScriptCache>();
DependencyManager::set<SoundCache>();
DependencyManager::set<SoundCacheScriptingInterface>();
#ifdef HAVE_DDE
DependencyManager::set<DdeFaceTracker>();
#endif
DependencyManager::set<EyeTracker>();
DependencyManager::set<AudioClient>();
DependencyManager::set<AudioScope>();
@ -3324,7 +3328,9 @@ void Application::onDesktopRootContextCreated(QQmlContext* surfaceContext) {
surfaceContext->setContextProperty("AccountServices", AccountServicesScriptingInterface::getInstance());
surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
#ifdef HAVE_DDE
surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
#endif
surfaceContext->setContextProperty("AvatarManager", DependencyManager::get<AvatarManager>().data());
surfaceContext->setContextProperty("LODManager", DependencyManager::get<LODManager>().data());
surfaceContext->setContextProperty("HMD", DependencyManager::get<HMDScriptingInterface>().data());
@ -5176,7 +5182,11 @@ ivec2 Application::getMouse() const {
FaceTracker* Application::getActiveFaceTracker() {
auto dde = DependencyManager::get<DdeFaceTracker>();
return dde->isActive() ? static_cast<FaceTracker*>(dde.data()) : nullptr;
if (dde && dde->isActive()) {
return static_cast<FaceTracker*>(dde.data());
}
return nullptr;
}
FaceTracker* Application::getSelectedFaceTracker() {
@ -7010,7 +7020,10 @@ void Application::copyDisplayViewFrustum(ViewFrustum& viewOut) const {
// feature. However, we still use this to reset face trackers, eye trackers, audio and to optionally re-load the avatar
// rig and animations from scratch.
void Application::resetSensors(bool andReload) {
#ifdef HAVE_DDE
DependencyManager::get<DdeFaceTracker>()->reset();
#endif
DependencyManager::get<EyeTracker>()->reset();
_overlayConductor.centerUI();
getActiveDisplayPlugin()->resetSensors();
@ -7402,8 +7415,10 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe
scriptEngine->registerGlobalObject("AccountServices", AccountServicesScriptingInterface::getInstance());
qScriptRegisterMetaType(scriptEngine.data(), DownloadInfoResultToScriptValue, DownloadInfoResultFromScriptValue);
#ifdef HAVE_DDE
scriptEngine->registerGlobalObject("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
#endif
scriptEngine->registerGlobalObject("AvatarManager", DependencyManager::get<AvatarManager>().data());
scriptEngine->registerGlobalObject("LODManager", DependencyManager::get<LODManager>().data());

View file

@ -14,8 +14,9 @@
#include <QtCore/QtGlobal>
//Disabling dde due to random crashes with closing the socket on macos. all the accompanying code is wrapped with the ifdef HAVE_DDE. uncomment the define below to enable
#if defined(Q_OS_WIN) || defined(Q_OS_OSX)
#define HAVE_DDE
//#define HAVE_DDE
#endif
#include <QProcess>

View file

@ -111,7 +111,7 @@ void setupPreferences() {
auto setter = [](bool value) { qApp->setSettingConstrainToolbarPosition(value); };
preferences->addPreference(new CheckPreference(UI_CATEGORY, "Constrain Toolbar Position to Horizontal Center", getter, setter));
}
{
auto getter = []()->bool { return qApp->getAwayStateWhenFocusLostInVREnabled(); };
auto setter = [](bool value) { qApp->setAwayStateWhenFocusLostInVREnabled(value); };
@ -231,7 +231,7 @@ void setupPreferences() {
"installation and system details, and crash events. By allowing High Fidelity to collect "
"this information you are helping to improve the product. ", getter, setter));
}
static const QString AVATAR_TUNING { "Avatar Tuning" };
{
auto getter = [myAvatar]()->QString { return myAvatar->getDominantHand(); };
@ -247,8 +247,8 @@ void setupPreferences() {
preference->setStep(0.05f);
preference->setDecimals(2);
preferences->addPreference(preference);
// When the Interface is first loaded, this section setupPreferences(); is loaded -
// When the Interface is first loaded, this section setupPreferences(); is loaded -
// causing the myAvatar->getDomainMinScale() and myAvatar->getDomainMaxScale() to get set to incorrect values
// which can't be changed across domain switches. Having these values loaded up when you load the Dialog each time
// is a way around this, therefore they're not specified here but in the QML.
@ -271,10 +271,14 @@ void setupPreferences() {
static const QString FACE_TRACKING{ "Face Tracking" };
{
#ifdef HAVE_DDE
auto getter = []()->float { return DependencyManager::get<DdeFaceTracker>()->getEyeClosingThreshold(); };
auto setter = [](float value) { DependencyManager::get<DdeFaceTracker>()->setEyeClosingThreshold(value); };
preferences->addPreference(new SliderPreference(FACE_TRACKING, "Eye Closing Threshold", getter, setter));
#endif
}
{
auto getter = []()->float { return FaceTracker::getEyeDeflection(); };
auto setter = [](float value) { FaceTracker::setEyeDeflection(value); };
@ -307,14 +311,14 @@ void setupPreferences() {
preferences->addPreference(preference);
}
{
auto getter = [myAvatar]() -> bool { return myAvatar->hoverWhenUnsupported(); };
auto getter = [myAvatar]()->bool { return myAvatar->hoverWhenUnsupported(); };
auto setter = [myAvatar](bool value) { myAvatar->setHoverWhenUnsupported(value); };
auto preference = new CheckPreference(VR_MOVEMENT, "Hover When Unsupported", getter, setter);
preferences->addPreference(preference);
}
{
auto getter = [myAvatar]()->int { return myAvatar->getMovementReference(); };
auto setter = [myAvatar](int value) { myAvatar->setMovementReference(value); };
auto setter = [myAvatar](int value) { myAvatar->setMovementReference(value); };
//auto preference = new CheckPreference(VR_MOVEMENT, "Hand-Relative Movement", getter, setter);
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Movement Direction", getter, setter);
QStringList items;
@ -520,6 +524,5 @@ void setupPreferences() {
preference->setStep(10);
preferences->addPreference(preference);
}
}
}