From 8110921abfd9d1e59f029c689f6a48ee0af3bca6 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 27 Feb 2017 11:11:04 -0800 Subject: [PATCH] git rid of _mouseToOverlays until I remember why I thought I needed it --- interface/src/Application.cpp | 38 +++++++++++------------------------ interface/src/Application.h | 2 -- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 3c6dffc3cf..28034828d3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3104,23 +3104,18 @@ void Application::mouseMoveEvent(QMouseEvent* event) { if (compositor.getReticleVisible() || !isHMDMode() || !compositor.getReticleOverDesktop() || getOverlays().getOverlayAtPoint(glm::vec2(transformedPos.x(), transformedPos.y())) != UNKNOWN_OVERLAY_ID) { - if (_mouseToOverlays) { - getOverlays().mouseMoveEvent(&mappedEvent); - } else { - getEntities()->mouseMoveEvent(&mappedEvent); - } + getOverlays().mouseMoveEvent(&mappedEvent); + getEntities()->mouseMoveEvent(&mappedEvent); } - if (!_mouseToOverlays) { - _controllerScriptingInterface->emitMouseMoveEvent(&mappedEvent); // send events to any registered scripts - } + _controllerScriptingInterface->emitMouseMoveEvent(&mappedEvent); // send events to any registered scripts // if one of our scripts have asked to capture this event, then stop processing it if (_controllerScriptingInterface->isMouseCaptured()) { return; } - if (!_mouseToOverlays && _keyboardMouseDevice->isActive()) { + if (_keyboardMouseDevice->isActive()) { _keyboardMouseDevice->mouseMoveEvent(event); } } @@ -3128,7 +3123,6 @@ void Application::mouseMoveEvent(QMouseEvent* event) { void Application::mousePressEvent(QMouseEvent* event) { // Inhibit the menu if the user is using alt-mouse dragging _altPressed = false; - _mouseToOverlays = false; auto offscreenUi = DependencyManager::get(); // If we get a mouse press event it means it wasn't consumed by the offscreen UI, @@ -3145,23 +3139,20 @@ void Application::mousePressEvent(QMouseEvent* event) { event->buttons(), event->modifiers()); if (!_aboutToQuit) { - if (getOverlays().mousePressEvent(&mappedEvent)) { - _mouseToOverlays = true; - } else if (!_controllerScriptingInterface->areEntityClicksCaptured()) { + getOverlays().mousePressEvent(&mappedEvent); + if (!_controllerScriptingInterface->areEntityClicksCaptured()) { getEntities()->mousePressEvent(&mappedEvent); } } - if (!_mouseToOverlays) { - _controllerScriptingInterface->emitMousePressEvent(&mappedEvent); // send events to any registered scripts - } + _controllerScriptingInterface->emitMousePressEvent(&mappedEvent); // send events to any registered scripts // if one of our scripts have asked to capture this event, then stop processing it if (_controllerScriptingInterface->isMouseCaptured()) { return; } - if (!_mouseToOverlays && hasFocus()) { + if (hasFocus()) { if (_keyboardMouseDevice->isActive()) { _keyboardMouseDevice->mousePressEvent(event); } @@ -3195,23 +3186,18 @@ void Application::mouseReleaseEvent(QMouseEvent* event) { event->buttons(), event->modifiers()); if (!_aboutToQuit) { - if (_mouseToOverlays) { - getOverlays().mouseReleaseEvent(&mappedEvent); - } else { - getEntities()->mouseReleaseEvent(&mappedEvent); - } + getOverlays().mouseReleaseEvent(&mappedEvent); + getEntities()->mouseReleaseEvent(&mappedEvent); } - if (!_mouseToOverlays) { - _controllerScriptingInterface->emitMouseReleaseEvent(&mappedEvent); // send events to any registered scripts - } + _controllerScriptingInterface->emitMouseReleaseEvent(&mappedEvent); // send events to any registered scripts // if one of our scripts have asked to capture this event, then stop processing it if (_controllerScriptingInterface->isMouseCaptured()) { return; } - if (!_mouseToOverlays && hasFocus()) { + if (hasFocus()) { if (_keyboardMouseDevice->isActive()) { _keyboardMouseDevice->mouseReleaseEvent(event); } diff --git a/interface/src/Application.h b/interface/src/Application.h index fa98f6bd6e..13c1458aee 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -676,8 +676,6 @@ private: void addAssetToWorldInfoDone(QString modelName); void addAssetToWorldError(QString modelName, QString errorText); - bool _mouseToOverlays { false }; - QQuickItem* _addAssetToWorldMessageBox{ nullptr }; QStringList _addAssetToWorldInfoKeys; // Model name QStringList _addAssetToWorldInfoMessages; // Info message