Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 17 files). Show all
Unified · Split
| @@ -96,8 +96,9 @@ bool HMDScriptingInterface::shouldShowHandControllers() const { · 95 unmodified lines | |||
| 96 | 96 | ||
| 97 | void HMDScriptingInterface::activateHMDHandMouse() { | 97 | void HMDScriptingInterface::activateHMDHandMouse() { |
| 98 | QWriteLocker lock(&_hmdHandMouseLock); | 98 | QWriteLocker lock(&_hmdHandMouseLock); |
| 99 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | 99 | if (auto offscreenUI = DependencyManager::get<OffscreenUi>()) { |
| 100 | offscreenUi->getDesktop()->setProperty("hmdHandMouseActive", true); | 100 | offscreenUI->getDesktop()->setProperty("hmdHandMouseActive", true); |
| 101 | } | ||
| 101 | _hmdHandMouseCount++; | 102 | _hmdHandMouseCount++; |
| 102 | } | 103 | } |
| 103 | 104 | ||
| @@ -105,8 +106,9 @@ void HMDScriptingInterface::deactivateHMDHandMouse() { · 1 unmodified line | |||
| 105 | QWriteLocker lock(&_hmdHandMouseLock); | 106 | QWriteLocker lock(&_hmdHandMouseLock); |
| 106 | _hmdHandMouseCount = std::max(_hmdHandMouseCount - 1, 0); | 107 | _hmdHandMouseCount = std::max(_hmdHandMouseCount - 1, 0); |
| 107 | if (_hmdHandMouseCount == 0) { | 108 | if (_hmdHandMouseCount == 0) { |
| 108 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); | 109 | if (auto offscreenUI = DependencyManager::get<OffscreenUi>()) { |
| 109 | offscreenUi->getDesktop()->setProperty("hmdHandMouseActive", false); | 110 | offscreenUI->getDesktop()->setProperty("hmdHandMouseActive", false); |
| 111 | } | ||
| 110 | } | 112 | } |
| 111 | } | 113 | } |
| 112 | 114 | ||