History

more safeguards

HifiExperiments committed 5 years ago

Commit 2667af31 parent 3335c0417 files · +94 −73Browse files

Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 17 files). Show all

Unified · Split

interface/src/scripting/HMDScriptingInterface.cpp+6−4
@@ -96,8 +96,9 @@ bool HMDScriptingInterface::shouldShowHandControllers() const { · 95 unmodified lines
96 96
97void HMDScriptingInterface::activateHMDHandMouse() {97void 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t