From d0af5580c8ff28bdff91337530deb4b6c989c0db Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 23 Apr 2015 10:28:03 -0700 Subject: [PATCH] Fix mouse wheel and clickthrough bugs in offscreen UI --- libraries/render-utils/src/OffscreenUi.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libraries/render-utils/src/OffscreenUi.cpp b/libraries/render-utils/src/OffscreenUi.cpp index db93a14b0d..969d3052cd 100644 --- a/libraries/render-utils/src/OffscreenUi.cpp +++ b/libraries/render-utils/src/OffscreenUi.cpp @@ -298,8 +298,11 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) { mapWindowToUi(wheelEvent->pos(), originalDestination), wheelEvent->delta(), wheelEvent->buttons(), wheelEvent->modifiers(), wheelEvent->orientation()); - QCoreApplication::sendEvent(_quickWindow, &mappedEvent); - return true; + mappedEvent.ignore(); + if (QCoreApplication::sendEvent(_quickWindow, &mappedEvent)) { + return mappedEvent.isAccepted(); + } + break; } // Fall through @@ -314,8 +317,11 @@ bool OffscreenUi::eventFilter(QObject* originalDestination, QEvent* event) { mapWindowToUi(transformedPos, originalDestination), mouseEvent->screenPos(), mouseEvent->button(), mouseEvent->buttons(), mouseEvent->modifiers()); - QCoreApplication::sendEvent(_quickWindow, &mappedEvent); - return QObject::event(event); + mappedEvent.ignore(); + if (QCoreApplication::sendEvent(_quickWindow, &mappedEvent)) { + return mappedEvent.isAccepted(); + } + break; } default: