Merge pull request #10242 from zzmp/fix/display-log

Send changed_display_mode after it changes
This commit is contained in:
Zach Pomerantz 2017-04-25 16:36:12 -04:00 committed by GitHub
commit d2bfcce3f7

View file

@ -6759,11 +6759,6 @@ void Application::updateDisplayMode() {
return;
}
UserActivityLogger::getInstance().logAction("changed_display_mode", {
{ "previous_display_mode", _displayPlugin ? _displayPlugin->getName() : "" },
{ "display_mode", newDisplayPlugin ? newDisplayPlugin->getName() : "" }
});
auto offscreenUi = DependencyManager::get<OffscreenUi>();
// Make the switch atomic from the perspective of other threads
@ -6818,13 +6813,16 @@ void Application::updateDisplayMode() {
offscreenUi->getDesktop()->setProperty("repositionLocked", wasRepositionLocked);
}
bool isHmd = _displayPlugin->isHmd();
qCDebug(interfaceapp) << "Entering into" << (isHmd ? "HMD" : "Desktop") << "Mode";
// Only log/emit after a successful change
UserActivityLogger::getInstance().logAction("changed_display_mode", {
{ "previous_display_mode", _displayPlugin ? _displayPlugin->getName() : "" },
{ "display_mode", newDisplayPlugin ? newDisplayPlugin->getName() : "" },
{ "hmd", isHmd }
});
emit activeDisplayPluginChanged();
if (_displayPlugin->isHmd()) {
qCDebug(interfaceapp) << "Entering into HMD Mode";
} else {
qCDebug(interfaceapp) << "Entering into Desktop Mode";
}
// reset the avatar, to set head and hand palms back to a reasonable default pose.
getMyAvatar()->reset(false);