diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ca3fcfdd1b..32517bc896 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1288,7 +1288,6 @@ void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) { } void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { - if (!_aboutToQuit) { _entities.mousePressEvent(event, deviceID); } diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index 455b73fb80..d991cb762c 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -244,6 +245,11 @@ void Overlays::deleteOverlay(unsigned int id) { } unsigned int Overlays::getOverlayAtPoint(const glm::vec2& point) { + glm::vec2 pointCpy = point; + if (OculusManager::isConnected()) { + pointCpy = Application::getInstance()->getApplicationOverlay().screenToOverlay(point); + } + QReadLocker lock(&_lock); QMapIterator i(_overlays2D); i.toBack(); @@ -251,7 +257,8 @@ unsigned int Overlays::getOverlayAtPoint(const glm::vec2& point) { i.previous(); unsigned int thisID = i.key(); Overlay2D* thisOverlay = static_cast(i.value()); - if (thisOverlay->getVisible() && thisOverlay->isLoaded() && thisOverlay->getBounds().contains(point.x, point.y, false)) { + if (thisOverlay->getVisible() && thisOverlay->isLoaded() && + thisOverlay->getBounds().contains(pointCpy.x, pointCpy.y, false)) { return thisID; } }