diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7577b35bca..71c4657264 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -955,7 +955,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo // Make sure we don't time out during slow operations at startup updateHeartbeat(); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuit())); + connect(this, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit())); // hook up bandwidth estimator QSharedPointer bandwidthRecorder = DependencyManager::get(); @@ -1449,7 +1449,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo }); sendStatsTimer->start(); - // Periodically check for count of nearby avatars static int lastCountOfNearbyAvatars = -1; QTimer* checkNearbyAvatarsTimer = new QTimer(this); @@ -1644,7 +1643,7 @@ void Application::updateHeartbeat() const { static_cast(_deadlockWatchdogThread)->updateHeartbeat(); } -void Application::aboutToQuit() { +void Application::onAboutToQuit() { emit beforeAboutToQuit(); foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) { diff --git a/interface/src/Application.h b/interface/src/Application.h index 9db492b177..adcdbe7b60 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -399,7 +399,7 @@ private slots: void showDesktop(); void clearDomainOctreeDetails(); void clearDomainAvatars(); - void aboutToQuit(); + void onAboutToQuit(); void resettingDomain(); diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index 4f939b6046..f9ec60c267 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -440,17 +440,27 @@ void Web3DOverlay::handlePointerEventAsTouch(const PointerEvent& event) { touchEvent->setTouchPoints(touchPoints); touchEvent->setTouchPointStates(touchPointState); + // Send mouse events to the Web surface so that HTML dialog elements work with mouse press and hover. + // FIXME: Scroll bar dragging is a bit unstable in the tablet (content can jump up and down at times). + // This may be improved in Qt 5.8. Release notes: "Cleaned up touch and mouse event delivery". + // + // In Qt 5.9 mouse events must be sent before touch events to make sure some QtQuick components will + // receive mouse events +#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 0) + if (!(this->_pressed && event.getType() == PointerEvent::Move)) { + QMouseEvent* mouseEvent = new QMouseEvent(mouseType, windowPoint, windowPoint, windowPoint, button, buttons, Qt::NoModifier); + QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent); + } +#endif QCoreApplication::postEvent(_webSurface->getWindow(), touchEvent); - if (this->_pressed && event.getType() == PointerEvent::Move) { +#if QT_VERSION < QT_VERSION_CHECK(5, 9, 0) + if (this->_pressed && event.getType() == PointerEvent::Move) { return; } - // Send mouse events to the Web surface so that HTML dialog elements work with mouse press and hover. - // FIXME: Scroll bar dragging is a bit unstable in the tablet (content can jump up and down at times). - // This may be improved in Qt 5.8. Release notes: "Cleaned up touch and mouse event delivery". - QMouseEvent* mouseEvent = new QMouseEvent(mouseType, windowPoint, windowPoint, windowPoint, button, buttons, Qt::NoModifier); QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent); +#endif } void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) {