diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-08 03:00:50 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-06-08 03:00:51 +0200 |
commit | e367643f57d0ce08759e9ec9a2e21696023036a9 (patch) | |
tree | 86dd9abdcb43c4be292606cf4da6ebe7f7433e0f | |
parent | 21a5038f8a2a6acc6dd1cc2f6bb0318d2c17f741 (diff) | |
parent | 0079313454e6980e8b533dc06d13e5a4f6c18461 (diff) |
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
-rw-r--r-- | src/client/qwaylandwindow.cpp | 2 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandcompositor.cpp | 2 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandtouch.cpp | 19 | ||||
-rw-r--r-- | src/compositor/compositor_api/qwaylandtouch_p.h | 2 |
4 files changed, 23 insertions, 2 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 4532bc236..8b2c12277 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -387,7 +387,7 @@ QWaylandScreen *QWaylandWindow::calculateScreenFromSurfaceEvents() const void QWaylandWindow::setVisible(bool visible) { if (visible) { - if (window()->type() & (Qt::Popup | Qt::ToolTip)) + if (window()->type() == Qt::Popup || window()->type() == Qt::ToolTip) activePopups << this; initWindow(); mDisplay->flushRequests(); diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 8ff9e0905..530cf8ed6 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -254,8 +254,10 @@ QWaylandCompositorPrivate::~QWaylandCompositorPrivate() delete data_device_manager; #endif +#if QT_CONFIG(opengl) // Some client buffer integrations need to clean up before the destroying the wl_display client_buffer_integration.reset(); +#endif if (ownsDisplay) wl_display_destroy(display); diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp index 3e7298001..15746cb5f 100644 --- a/src/compositor/compositor_api/qwaylandtouch.cpp +++ b/src/compositor/compositor_api/qwaylandtouch.cpp @@ -98,6 +98,20 @@ void QWaylandTouchPrivate::sendMotion(QWaylandClient *client, uint32_t time, int wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); } +int QWaylandTouchPrivate::toSequentialWaylandId(int touchId) +{ + const int waylandId = ids.indexOf(touchId); + if (waylandId != -1) + return waylandId; + const int availableId = ids.indexOf(-1); + if (availableId != -1) { + ids[availableId] = touchId; + return availableId; + } + ids.append(touchId); + return ids.length() - 1; +} + /*! * \class QWaylandTouch * \inmodule QtWaylandCompositor @@ -212,7 +226,10 @@ void QWaylandTouch::sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *ev for (int i = 0; i < pointCount; ++i) { const QTouchEvent::TouchPoint &tp(points.at(i)); // Convert the local pos in the compositor window to surface-relative. - sendTouchPointEvent(surface, tp.id(), tp.pos(), tp.state()); + const int id = d->toSequentialWaylandId(tp.id()); + sendTouchPointEvent(surface, id, tp.pos(), tp.state()); + if (tp.state() == Qt::TouchPointReleased) + d->ids[id] = -1; } sendFrameEvent(surface->client()); } diff --git a/src/compositor/compositor_api/qwaylandtouch_p.h b/src/compositor/compositor_api/qwaylandtouch_p.h index de1b748de..0b87f8475 100644 --- a/src/compositor/compositor_api/qwaylandtouch_p.h +++ b/src/compositor/compositor_api/qwaylandtouch_p.h @@ -80,8 +80,10 @@ public: private: void touch_release(Resource *resource) override; + int toSequentialWaylandId(int touchId); QWaylandSeat *seat = nullptr; + QVarLengthArray<int, 10> ids; }; QT_END_NAMESPACE |