From 858a1db38b8cf5afce9ad9470bf820d91f3eb345 Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Tue, 18 Apr 2017 18:44:48 -0400 Subject: [PATCH 1/2] only log changed_display_mode on successful change --- interface/src/Application.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c6cd185034..b27612c594 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6736,11 +6736,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(); // Make the switch atomic from the perspective of other threads @@ -6788,13 +6783,15 @@ 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() : "" } + }); 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); From e0cb809f5879d379cd4cfc6e9b0b992a0f9b4a7f Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Tue, 18 Apr 2017 18:45:03 -0400 Subject: [PATCH 2/2] add hmd:bool to changed_display_mode --- interface/src/Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b27612c594..a9b60a6205 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6789,7 +6789,8 @@ void Application::updateDisplayMode() { // Only log/emit after a successful change UserActivityLogger::getInstance().logAction("changed_display_mode", { { "previous_display_mode", _displayPlugin ? _displayPlugin->getName() : "" }, - { "display_mode", newDisplayPlugin ? newDisplayPlugin->getName() : "" } + { "display_mode", newDisplayPlugin ? newDisplayPlugin->getName() : "" }, + { "hmd", isHmd } }); emit activeDisplayPluginChanged();