mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 19:21:16 +02:00
Send mouse events before touch event. It seems the order is important for Qt 5.9
This commit is contained in:
parent
87a6b16d16
commit
5a0783c38c
3 changed files with 12 additions and 11 deletions
|
@ -953,7 +953,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
|
||||||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(aboutToQuit()));
|
connect(this, SIGNAL(aboutToQuit()), this, SLOT(onAboutToQuit()));
|
||||||
|
|
||||||
// hook up bandwidth estimator
|
// hook up bandwidth estimator
|
||||||
QSharedPointer<BandwidthRecorder> bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
QSharedPointer<BandwidthRecorder> bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
|
||||||
|
@ -1238,7 +1238,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(this, &Application::aboutToQuit, [=]() {
|
QObject::connect(this, &Application::aboutToQuit, [=]() {
|
||||||
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
||||||
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||||
});
|
});
|
||||||
|
@ -1447,7 +1447,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
});
|
});
|
||||||
sendStatsTimer->start();
|
sendStatsTimer->start();
|
||||||
|
|
||||||
|
|
||||||
// Periodically check for count of nearby avatars
|
// Periodically check for count of nearby avatars
|
||||||
static int lastCountOfNearbyAvatars = -1;
|
static int lastCountOfNearbyAvatars = -1;
|
||||||
QTimer* checkNearbyAvatarsTimer = new QTimer(this);
|
QTimer* checkNearbyAvatarsTimer = new QTimer(this);
|
||||||
|
@ -1642,7 +1641,7 @@ void Application::updateHeartbeat() const {
|
||||||
static_cast<DeadlockWatchdogThread*>(_deadlockWatchdogThread)->updateHeartbeat();
|
static_cast<DeadlockWatchdogThread*>(_deadlockWatchdogThread)->updateHeartbeat();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::aboutToQuit() {
|
void Application::onAboutToQuit() {
|
||||||
emit beforeAboutToQuit();
|
emit beforeAboutToQuit();
|
||||||
|
|
||||||
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
|
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
|
||||||
|
|
|
@ -401,7 +401,7 @@ private slots:
|
||||||
void showDesktop();
|
void showDesktop();
|
||||||
void clearDomainOctreeDetails();
|
void clearDomainOctreeDetails();
|
||||||
void clearDomainAvatars();
|
void clearDomainAvatars();
|
||||||
void aboutToQuit();
|
void onAboutToQuit();
|
||||||
|
|
||||||
void resettingDomain();
|
void resettingDomain();
|
||||||
|
|
||||||
|
|
|
@ -441,17 +441,19 @@ void Web3DOverlay::handlePointerEventAsTouch(const PointerEvent& event) {
|
||||||
touchEvent->setTouchPoints(touchPoints);
|
touchEvent->setTouchPoints(touchPoints);
|
||||||
touchEvent->setTouchPointStates(touchPointState);
|
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
|
||||||
|
QMouseEvent* mouseEvent = new QMouseEvent(mouseType, windowPoint, windowPoint, windowPoint, button, buttons, Qt::NoModifier);
|
||||||
|
QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent);
|
||||||
|
|
||||||
QCoreApplication::postEvent(_webSurface->getWindow(), touchEvent);
|
QCoreApplication::postEvent(_webSurface->getWindow(), touchEvent);
|
||||||
|
|
||||||
if (this->_pressed && event.getType() == PointerEvent::Move) {
|
if (this->_pressed && event.getType() == PointerEvent::Move) {
|
||||||
return;
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) {
|
void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) {
|
||||||
|
|
Loading…
Reference in a new issue