diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2019-03-21 11:42:15 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2019-03-21 11:57:15 +0100 |
commit | 77e8ee63dc9ad0a4c139f35f8cf078d1a5bd315c (patch) | |
tree | 499f94df98fc25bca2982fba4dd67457f42bd6b9 /src/compositor/compositor_api | |
parent | df3a1761af2f20d59ae09a7adaa2f5b959047687 (diff) | |
parent | c0905957be0d7db90c9d9f05069a259575753dfe (diff) |
Merge remote-tracking branch 'qt/5.13' into dev
Change-Id: I3dc204fcaa71c01a80b0c622443012eb07964431
Diffstat (limited to 'src/compositor/compositor_api')
6 files changed, 50 insertions, 13 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 173b50ce0..053235432 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -243,6 +243,9 @@ QWaylandCompositorPrivate::~QWaylandCompositorPrivate() delete data_device_manager; #endif + // Some client buffer integrations need to clean up before the destroying the wl_display + client_buffer_integration.reset(); + wl_display_destroy(display); } @@ -583,7 +586,7 @@ QByteArray QWaylandCompositor::socketName() const * \qmlmethod QtWaylandCompositor::WaylandCompositor::addSocketDescriptor(fd) * \since 5.12 * - * Listen for client connections on a file descriptor referring to a + * Listen for client connections on a file descriptor, \a fd, referring to a * server socket already bound and listening. * * Does not take ownership of the file descriptor; it must be closed @@ -595,7 +598,7 @@ QByteArray QWaylandCompositor::socketName() const */ /*! - * Listen for client connections on a file descriptor referring to a + * Listen for client connections on a file descriptor, \a fd, referring to a * server socket already bound and listening. * * Does not take ownership of the file descriptor; it must be closed diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index 68d855a66..5f3bd3d4b 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -486,7 +486,7 @@ QWaylandClient *QWaylandKeyboard::focusClient() const /*! * Sends the current key modifiers to \a client with the given \a serial. */ -void QWaylandKeyboard::sendKeyModifiers(QWaylandClient *client, uint serial) +void QWaylandKeyboard::sendKeyModifiers(QWaylandClient *client, uint32_t serial) { Q_D(QWaylandKeyboard); QtWaylandServer::wl_keyboard::Resource *resource = d->resourceMap().value(client->client()); diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 6e41c7c0a..fb73760b4 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -295,7 +295,8 @@ public: } auto texture = buffer.toOpenGLTexture(); - m_sgTex = surfaceItem->window()->createTextureFromId(texture->textureId() , QSize(surfaceItem->width(), surfaceItem->height()), opt); + auto size = surface->bufferSize(); + m_sgTex = surfaceItem->window()->createTextureFromId(texture->textureId(), size, opt); } } emit textureChanged(); @@ -825,6 +826,15 @@ void QWaylandQuickItem::setOutput(QWaylandOutput *output) } /*! + * \qmlproperty bool QtWaylandCompositor::WaylandQuickItem::bufferLocked + * + * This property holds whether the item's buffer is currently locked. As long as + * the buffer is locked, it will not be released and returned to the client. + * + * The default is false. + */ + +/*! * \property QWaylandQuickItem::bufferLocked * * This property holds whether the item's buffer is currently locked. As long as @@ -1058,6 +1068,14 @@ bool QWaylandQuickItem::inputRegionContains(const QPointF &localPosition) } /*! + * \qmlmethod point WaylandQuickItem::mapToSurface(point point) + * + * Maps the given \a point in this item's coordinate system to the equivalent + * point within the Wayland surface's coordinate system, and returns the mapped + * coordinate. + */ + +/*! * Maps the given \a point in this item's coordinate system to the equivalent * point within the Wayland surface's coordinate system, and returns the mapped * coordinate. @@ -1075,9 +1093,19 @@ QPointF QWaylandQuickItem::mapToSurface(const QPointF &point) const } /*! + * \qmlmethod point WaylandQuickItem::mapFromSurface(point point) + * \since 5.13 + * * Maps the given \a point in the Wayland surfaces's coordinate system to the equivalent * point within this item's coordinate system, and returns the mapped coordinate. */ + +/*! + * Maps the given \a point in the Wayland surfaces's coordinate system to the equivalent + * point within this item's coordinate system, and returns the mapped coordinate. + * + * \since 5.13 + */ QPointF QWaylandQuickItem::mapFromSurface(const QPointF &point) const { Q_D(const QWaylandQuickItem); diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h index 269e55567..2aa8e1b73 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.h +++ b/src/compositor/compositor_api/qwaylandquickitem.h @@ -102,7 +102,7 @@ public: bool inputRegionContains(const QPointF &localPosition) const; bool inputRegionContains(const QPointF &localPosition); Q_INVOKABLE QPointF mapToSurface(const QPointF &point) const; - Q_INVOKABLE QPointF mapFromSurface(const QPointF &point) const; + Q_REVISION(13) Q_INVOKABLE QPointF mapFromSurface(const QPointF &point) const; bool sizeFollowsSurface() const; void setSizeFollowsSurface(bool sizeFollowsSurface); diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index cc61fb17a..826cd3fdc 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -481,6 +481,7 @@ bool QWaylandSurface::hasContent() const /*! * \qmlproperty rect QtWaylandCompositor::WaylandSurface::sourceGeometry + * \since 5.13 * * This property describes the portion of the attached Wayland buffer that should * be drawn on the screen. The coordinates are from the corner of the buffer and are @@ -493,6 +494,7 @@ bool QWaylandSurface::hasContent() const /*! * \property QWaylandSurface::sourceGeometry + * \since 5.13 * * This property describes the portion of the attached QWaylandBuffer that should * be drawn on the screen. The coordinates are from the corner of the buffer and are @@ -510,6 +512,7 @@ QRectF QWaylandSurface::sourceGeometry() const /*! * \qmlproperty size QtWaylandCompositor::WaylandSurface::destinationSize + * \since 5.13 * * This property holds the size of this WaylandSurface in surface coordinates. * @@ -519,6 +522,7 @@ QRectF QWaylandSurface::sourceGeometry() const /*! * \property QWaylandSurface::destinationSize + * \since 5.13 * * This property holds the size of this WaylandSurface in surface coordinates. * @@ -843,7 +847,7 @@ QList<QWaylandView *> QWaylandSurface::views() const } /*! - * Returns the QWaylandSurface corresponding to the Wayland resource \a res. + * Returns the QWaylandSurface corresponding to the Wayland resource \a resource. */ QWaylandSurface *QWaylandSurface::fromResource(::wl_resource *resource) { @@ -862,11 +866,12 @@ struct wl_resource *QWaylandSurface::resource() const } /*! - * Sets a \a role on the surface. A role defines how a surface will be mapped on screen, without a role - * a surface is supposed to be hidden. Only one role at all times can be set on a surface. Although + * Sets a \a role on the surface. A role defines how a surface will be mapped on screen; without a role + * a surface is supposed to be hidden. Only one role can be set on a surface, at all times. Although * setting the same role many times is allowed, attempting to change the role of a surface will trigger * a protocol error to the \a errorResource and send an \a errorCode to the client. * + * Returns true if a role can be assigned; false otherwise. */ bool QWaylandSurface::setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode) { diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index 9bf842900..667f911c3 100644 --- a/src/compositor/compositor_api/qwaylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -81,8 +81,9 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandSurface : public QWaylandObject Q_OBJECT Q_DECLARE_PRIVATE(QWaylandSurface) Q_PROPERTY(QWaylandClient *client READ client CONSTANT) - Q_PROPERTY(QRectF sourceGeometry READ sourceGeometry NOTIFY sourceGeometryChanged) - Q_PROPERTY(QSize destinationSize READ destinationSize NOTIFY destinationSizeChanged) + Q_PROPERTY(QRectF sourceGeometry READ sourceGeometry NOTIFY sourceGeometryChanged REVISION 13) + Q_PROPERTY(QSize destinationSize READ destinationSize NOTIFY destinationSizeChanged REVISION 13) + Q_PROPERTY(QSize bufferSize READ bufferSize NOTIFY bufferSizeChanged REVISION 13) #if QT_DEPRECATED_SINCE(5, 13) Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) // Qt 6: Remove #endif @@ -164,12 +165,12 @@ Q_SIGNALS: void damaged(const QRegion &rect); void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent); void childAdded(QWaylandSurface *child); - void sourceGeometryChanged(); - void destinationSizeChanged(); + Q_REVISION(13) void sourceGeometryChanged(); + Q_REVISION(13) void destinationSizeChanged(); #if QT_DEPRECATED_SINCE(5, 13) QT_DEPRECATED void sizeChanged(); #endif - void bufferSizeChanged(); + Q_REVISION(13) void bufferSizeChanged(); void bufferScaleChanged(); void offsetForNextFrame(const QPoint &offset); void contentOrientationChanged(); |