Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -859,6 +859,18 @@ void Application::initializeUi() { · 858 unmodified lines | ||
| 859 | 859 | offscreenUi->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/")); |
| 860 | 860 | offscreenUi->load("Root.qml"); |
| 861 | 861 | offscreenUi->load("RootMenu.qml"); |
| 862 | + | |
| 863 | + offscreenUi->setMouseTranslator([=](const QPointF& pt) { | |
| 864 | + QPointF result = pt; | |
| 865 | + auto displayPlugin = getActiveDisplayPlugin(); | |
| 866 | + if (displayPlugin->isHmd()) { | |
| 867 | + auto resultVec = _compositor.screenToOverlay(toGlm(pt)); | |
| 868 | + result = QPointF(resultVec.x, resultVec.y); | |
| 869 | + } else if (displayPlugin->isStereo()) { | |
| 870 | + } | |
| 871 | + return result; | |
| 872 | + }); | |
| 873 | + | |
| 862 | 874 | VrMenu::load(); |
| 863 | 875 | VrMenu::executeQueuedLambdas(); |
| 864 | 876 | offscreenUi->resume(); |
| @@ -4813,7 +4825,6 @@ void Application::updateDisplayMode() { · 3948 unmodified lines | ||
| 4813 | 4825 | } else { |
| 4814 | 4826 | DependencyManager::get<OffscreenUi>()->setProxyWindow(nullptr); |
| 4815 | 4827 | } |
| 4816 | − offscreenUi->setMouseTranslator(newDisplayPlugin->getMouseTranslator()); | |
| 4817 | 4828 | offscreenUi->resize(fromGlm(newDisplayPlugin->getCanvasSize())); |
| 4818 | 4829 | _offscreenContext->makeCurrent(); |
| 4819 | 4830 | } |