Since switching to system mouse due to eco mode trailing mouse issues, this in turn caused hmd mode to render a blank mouse. Added a mouse setting functionality on activeplugin change lambda so taht when in hmd mode it uses either reticle mouse, if selected, or arrow. Othewise if non hmd use system mouse.

This commit is contained in:
amer cerkic 2019-07-02 10:31:31 -07:00
parent df34e2f86d
commit 75beb95a97

View file

@ -1345,9 +1345,22 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(this, &QCoreApplication::aboutToQuit, addressManager.data(), &AddressManager::storeCurrentAddress);
connect(this, &Application::activeDisplayPluginChanged, this, &Application::updateThreadPoolCount);
connect(this, &Application::activeDisplayPluginChanged, this, [](){
connect(this, &Application::activeDisplayPluginChanged, this, [=](){
qApp->setProperty(hifi::properties::HMD, qApp->isHMDMode());
auto displayPlugin = qApp->getActiveDisplayPlugin();
if (displayPlugin->isHmd()) {
if (_preferredCursor.get() == Cursor::Manager::getIconName(Cursor::Icon::RETICLE)) {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::RETICLE));
}
else {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::ARROW));
}
}
else {
setPreferredCursor(Cursor::Manager::getIconName(Cursor::Icon::SYSTEM));
}
setCrashAnnotation("display_plugin", displayPlugin->getName().toStdString());
setCrashAnnotation("hmd", displayPlugin->isHmd() ? "1" : "0");
});