From 75beb95a97cbf4ea96cf0e31f4fc2a3a7833efbb Mon Sep 17 00:00:00 2001 From: amer cerkic Date: Tue, 2 Jul 2019 10:31:31 -0700 Subject: [PATCH] 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. --- interface/src/Application.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8ecb16b65f..f8dadcbc22 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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"); });