From 2767d0533f2901517c87d9c99bcda26564484280 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 21 Nov 2017 10:13:43 +0100 Subject: Revert "Ref count buffer usage" When a buffer is committed multiple times, not all compositors (i.e. Weston) send a matching number of release events. This caused clients to freeze on some occasions on those compositors because they were waiting for a release event that never came. This reverts commit 5f38652cd52c03e9df8600f5f41e044820c3062c. Task-number: QTBUG-64631 Change-Id: I818d9bd71e5d9ce7a351a2010914b7219b1975bc Reviewed-by: David Edmundson Reviewed-by: Paul Olav Tvete --- src/client/qwaylandbuffer.cpp | 2 +- src/client/qwaylandbuffer_p.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp index 076a0d57d..a0fcc532f 100644 --- a/src/client/qwaylandbuffer.cpp +++ b/src/client/qwaylandbuffer.cpp @@ -66,7 +66,7 @@ void QWaylandBuffer::init(wl_buffer *buf) void QWaylandBuffer::release(void *data, wl_buffer *) { - static_cast(data)->mBusy--; + static_cast(data)->mBusy = false; } const wl_buffer_listener QWaylandBuffer::listener = { diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h index b3513d151..9e8cba2e4 100644 --- a/src/client/qwaylandbuffer_p.h +++ b/src/client/qwaylandbuffer_p.h @@ -73,14 +73,14 @@ public: virtual QSize size() const = 0; virtual int scale() const { return 1; } - void setBusy() { mBusy++; } - bool busy() const { return mBusy > 0; } + void setBusy() { mBusy = true; } + bool busy() const { return mBusy; } protected: struct wl_buffer *mBuffer; private: - int mBusy; + bool mBusy; static void release(void *data, wl_buffer *); static const wl_buffer_listener listener; -- cgit v1.2.3 From 806dc04fdb7eec148fefe28670774e9a827688bb Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 15:24:14 +0200 Subject: Add documentation for QWaylandQuickItem::surfaceDestroyed Change-Id: I7fd1e44974857b77fea27e75ef791603e607642e Reviewed-by: Pier Luigi Fiorini Reviewed-by: Venugopal Shivashankar --- .../compositor_api/qwaylandquickitem.cpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index f31bf39e9..998250db6 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -1156,6 +1156,32 @@ void QWaylandQuickItem::updateInputMethod(Qt::InputMethodQueries queries) } #endif +/*! + * \qmlsignal void QtWaylandCompositor::WaylandQuickItem::surfaceDestroyed() + * + * This signal is emitted when the client has destroyed the \c wl_surface associated + * with the WaylandQuickItem. The handler for this signal is expected to either destroy the + * WaylandQuickItem immediately or start a close animation and then destroy the Item. + * + * If an animation is started, bufferLocked should be set to ensure the item keeps its content + * until the animation finishes + * + * \sa bufferLocked + */ + +/*! + * \fn void QWaylandQuickItem::surfaceDestroyed() + * + * This signal is emitted when the client has destroyed the \c wl_surface associated + * with the QWaylandQuickItem. The handler for this signal is expected to either destroy the + * QWaylandQuickItem immediately or start a close animation and then destroy the Item. + * + * If an animation is started, bufferLocked should be set to ensure the item keeps its content + * until the animation finishes + * + * \sa QWaylandQuickkItem::bufferLocked + */ + QSGNode *QWaylandQuickItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { Q_D(QWaylandQuickItem); -- cgit v1.2.3 From a02a48fc50203350c631dcb2032737a22a19b81b Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 22 Nov 2017 14:02:42 +0100 Subject: Fix various documentation errors for QML methods and signals Change-Id: I9461fae92ec3d41e4f9e866a6a4fa7554a309ecd Reviewed-by: Pier Luigi Fiorini --- src/compositor/compositor_api/qwaylandcompositor.cpp | 2 +- src/compositor/compositor_api/qwaylandoutput.cpp | 2 +- src/compositor/compositor_api/qwaylandsurface.cpp | 4 ++-- src/compositor/extensions/qwaylandiviapplication.cpp | 4 ++-- src/compositor/extensions/qwaylandivisurface.cpp | 4 ++-- src/compositor/extensions/qwaylandwlshell.cpp | 4 ++-- src/compositor/extensions/qwaylandxdgshellv5.cpp | 10 +++++----- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 99b484e20..3b296f3a6 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -284,7 +284,7 @@ void QWaylandCompositorPrivate::addPolishObject(QObject *object) } /*! - \qmlsignal void QtWaylandCompositor::WaylandCompositor::createSurface(object client, int id, int version) + \qmlsignal void QtWaylandCompositor::WaylandCompositor::createSurface(WaylandClient client, int id, int version) This signal is emitted when a client has created a surface. The slot connecting to this signal may create and initialize diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 77d3dc1a9..c369bb26c 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -838,7 +838,7 @@ void QWaylandOutput::setSizeFollowsWindow(bool follow) } /*! - * \qmlproperty object QtWaylandCompositor::WaylandOutput::window + * \qmlproperty Window QtWaylandCompositor::WaylandOutput::window * * This property holds the Window for this WaylandOutput. * diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 945d68827..05113c41c 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -410,7 +410,7 @@ QWaylandSurface::~QWaylandSurface() } /*! - * \qmlmethod void QtWaylandCompositor::WaylandSurface::initialize(object compositor, object client, int id, int version) + * \qmlmethod void QtWaylandCompositor::WaylandSurface::initialize(WaylandCompositor compositor, WaylandClient client, int id, int version) * * Initializes the WaylandSurface with the given \a compositor and \a client, and with the given \a id * and \a version. @@ -888,7 +888,7 @@ void QWaylandSurfacePrivate::Subsurface::subsurface_set_desync(wl_subsurface::Re } /*! - * \qmlsignal void QtWaylandCompositor::WaylandSurface::dragStarted(object drag) + * \qmlsignal void QtWaylandCompositor::WaylandSurface::dragStarted(WaylandDrag drag) * * This signal is emitted when a \a drag has started from this surface. */ diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index d04662447..1190eb2a1 100644 --- a/src/compositor/extensions/qwaylandiviapplication.cpp +++ b/src/compositor/extensions/qwaylandiviapplication.cpp @@ -137,7 +137,7 @@ QByteArray QWaylandIviApplication::interfaceName() } /*! - * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceRequested(object surface, int iviId, object resource) + * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceRequested(WaylandSurface surface, int iviId, WaylandResource resource) * * This signal is emitted when the client has requested an \c ivi_surface to be associated * with \a surface, which is identified by \a id. The handler for this signal is @@ -155,7 +155,7 @@ QByteArray QWaylandIviApplication::interfaceName() */ /*! - * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceCreated(object *iviSurface) + * \qmlsignal void QtWaylandCompositor::IviApplication::iviSurfaceCreated(IviSurface *iviSurface) * * This signal is emitted when an IviSurface has been created. The supplied \a iviSurface is * most commonly used to instantiate a ShellSurfaceItem. diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index 08b95b3b5..2bdd4a14d 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -93,10 +93,10 @@ QWaylandIviSurface::QWaylandIviSurface(QWaylandIviApplication *application, QWay } /*! - * \qmlmethod void QtWaylandCompositor::IviSurface::initialize(object iviApplication, object surface, int iviId, object resource) + * \qmlmethod void QtWaylandCompositor::IviSurface::initialize(IviApplication iviApplication, WaylandSurface surface, int iviId, WaylandResource resource) * * Initializes the IviSurface, associating it with the given \a iviApplication, \a surface, - * \a client, \a iviId, and \a resource. + * \a iviId, and \a resource. */ /*! diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 96dbd3dc1..36c579e95 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -475,9 +475,9 @@ QWaylandWlShellSurface::~QWaylandWlShellSurface() } /*! - * \qmlmethod void QtWaylandCompositor::WlShellSurface::initialize(object shell, object surface, object client, int id) + * \qmlmethod void QtWaylandCompositor::WlShellSurface::initialize(WlShell shell, WaylandSurface surface, WaylandResource resource) * - * Initializes the WlShellSurface with \a id and associates it with the given \a shell, \a surface, and \a client. + * Initializes the WlShellSurface and associates it with the given \a shell, \a surface, and \a resource. */ /*! diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index c0cb4f8e4..8019afe00 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -825,10 +825,10 @@ QWaylandXdgSurfaceV5::QWaylandXdgSurfaceV5(QWaylandXdgShellV5 *xdgShell, QWaylan } /*! - * \qmlmethod void QtWaylandCompositor::XdgSurfaceV5::initialize(object surface, object client, int id) + * \qmlmethod void QtWaylandCompositor::XdgSurfaceV5::initialize(XdgShellV5 xdgShell, WaylandSurface surface, WaylandResource resource) * - * Initializes the XdgSurfaceV5, associating it with the given \a surface, - * \a client, and \a id. + * Initializes the XdgSurfaceV5, associating it with the given \a xdgShell, \a surface, + * and \a resource. */ /*! @@ -1367,10 +1367,10 @@ QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSur } /*! - * \qmlmethod void QtWaylandCompositor::XdgPopupV5::initialize(object surface, object parentSurface, object resource) + * \qmlmethod void QtWaylandCompositor::XdgPopupV5::initialize(XdgShellV5 shell, WaylandSurface surface, WaylandSurface parentSurface, point position, WaylandResource resource) * * Initializes the xdg popup, associating it with the given \a shell, \a surface, - * \a parentSurface and \a resource. + * \a parentSurface, \a position and \a resource. */ /*! -- cgit v1.2.3 From 800c71ca816d76ac4de0616bf54b87f3c1f14c0a Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 29 Nov 2017 10:21:16 +0100 Subject: Fix decoding of multi-planar surfaces (YUV video) QOpenGLTexture::bind() expects texture unit number as plain uint number (e.g. 0,1,2) and not as GLenum (GL_TEXTURE1) Task-number: QTBUG-64841 Change-Id: Id471fc9976677ac8a358f04b9ae09c6a32beef63 Reviewed-by: Johan Helsing --- src/compositor/compositor_api/qwaylandquickitem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 998250db6..4b6da1e38 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -221,13 +221,13 @@ void QWaylandBufferMaterial::bind() switch (m_textures.size()) { case 3: if (m_textures[2]) - m_textures[2]->bind(GL_TEXTURE2); + m_textures[2]->bind(2); case 2: if (m_textures[1]) - m_textures[1]->bind(GL_TEXTURE1); + m_textures[1]->bind(1); case 1: if (m_textures[0]) - m_textures[0]->bind(GL_TEXTURE0); + m_textures[0]->bind(0); } } -- cgit v1.2.3 From d185d5d1b8422158d0a33aa2c88831662079300e Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Wed, 22 Nov 2017 13:03:58 +0200 Subject: wayland-egl: use egl compiler options Change-Id: I6f8dcadf3cffecc6097ad0ad5e8245831b3ce0c1 Reviewed-by: Paul Olav Tvete --- src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri index df3aead3e..e20c6802c 100644 --- a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri +++ b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri @@ -1,6 +1,6 @@ INCLUDEPATH += $$PWD -QMAKE_USE_PRIVATE += wayland-server wayland-egl +QMAKE_USE_PRIVATE += egl wayland-server wayland-egl QT += egl_support-private -- cgit v1.2.3 From e74ff73d2b2acef0b97530a2c7dd52e20ada6239 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 23 Nov 2017 16:15:57 +0100 Subject: Fix broken documentation Change-Id: I16f11c32c861908e34de0cb28c8ad51378aa6e61 Reviewed-by: Martin Smith --- src/compositor/compositor_api/qwaylandclient.cpp | 2 +- .../compositor_api/qwaylandcompositor.cpp | 65 +++++++++++----------- .../compositor_api/qwaylandquickitem.cpp | 12 +--- .../extensions/qwaylandiviapplication.cpp | 6 +- src/compositor/extensions/qwaylandwlshell.cpp | 5 -- src/compositor/extensions/qwaylandxdgshellv5.cpp | 9 +-- 6 files changed, 40 insertions(+), 59 deletions(-) (limited to 'src') diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp index f6b5564b8..2b73c06ca 100644 --- a/src/compositor/compositor_api/qwaylandclient.cpp +++ b/src/compositor/compositor_api/qwaylandclient.cpp @@ -221,7 +221,7 @@ qint64 QWaylandClient::userId() const */ /*! - * \property int QWaylandClient::groupId + * \property QWaylandClient::groupId * * This property holds the group id of this QWaylandClient. */ diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 3b296f3a6..4e7040889 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -283,39 +283,6 @@ void QWaylandCompositorPrivate::addPolishObject(QObject *object) } } -/*! - \qmlsignal void QtWaylandCompositor::WaylandCompositor::createSurface(WaylandClient client, int id, int version) - - This signal is emitted when a client has created a surface. - The slot connecting to this signal may create and initialize - a WaylandSurface instance in the scope of the slot. - Otherwise a default surface is created. -*/ - -/*! - \fn void QWaylandCompositor::createSurface(QWaylandClient *client, uint id, int version) - - This signal is emitted when a client has created a surface. - The slot connecting to this signal may create and initialize - a QWaylandSurface instance in the scope of the slot. - Otherwise a default surface is created. - - Connections to this signal must be of Qt::DirectConnection connection type. -*/ - -/* - \qmlsignal void surfaceCreated(QWaylandSurface *surface) - - This signal is emitted when a new WaylandSurface instance has been created. -*/ - -/* - \fn void surfaceCreated(QWaylandSurface *surface) - - This signal is emitted when a new QWaylandSurface instance has been created. -*/ - - void QWaylandCompositorPrivate::compositor_create_surface(wl_compositor::Resource *resource, uint32_t id) { Q_Q(QWaylandCompositor); @@ -464,6 +431,38 @@ void QWaylandCompositorPrivate::loadServerBufferIntegration() instance, which can have several outputs as children. */ +/*! + \qmlsignal void QtWaylandCompositor::WaylandCompositor::surfaceRequested(WaylandClient client, int id, int version) + + This signal is emitted when a client has created a surface. + The slot connecting to this signal may create and initialize + a WaylandSurface instance in the scope of the slot. + Otherwise a default surface is created. +*/ + +/*! + \fn void QWaylandCompositor::surfaceRequested(QWaylandClient *client, uint id, int version) + + This signal is emitted when a client has created a surface. + The slot connecting to this signal may create and initialize + a QWaylandSurface instance in the scope of the slot. + Otherwise a default surface is created. + + Connections to this signal must be of Qt::DirectConnection connection type. +*/ + +/*! + \qmlsignal void QtWaylandCompositor::WaylandCompositor::surfaceCreated(QWaylandSurface *surface) + + This signal is emitted when a new WaylandSurface instance has been created. +*/ + +/*! + \fn void QWaylandCompositor::surfaceCreated(QWaylandSurface *surface) + + This signal is emitted when a new QWaylandSurface instance has been created. +*/ + /*! * Constructs a QWaylandCompositor with the given \a parent. */ diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 4b6da1e38..00c3117ad 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -386,15 +386,7 @@ QWaylandCompositor *QWaylandQuickItem::compositor() const } /*! - * \qmlproperty WaylandView QtWaylandCompositor::WaylandQuickItem::view - * - * This property holds the view rendered by this WaylandQuickItem. - */ - -/*! - * \property QWaylandQuickItem::view - * - * This property holds the view rendered by this QWaylandQuickItem. + * Returns the view rendered by this QWaylandQuickItem. */ QWaylandView *QWaylandQuickItem::view() const { @@ -815,7 +807,7 @@ void QWaylandQuickItem::setBufferLocked(bool locked) } /*! - * \property bool QWaylandQuickItem::allowDiscardFrontBuffer + * \property QWaylandQuickItem::allowDiscardFrontBuffer * * By default, the item locks the current buffer until a new buffer is available * and updatePaintNode() is called. Set this property to true to allow Qt to release the buffer diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index 1190eb2a1..8295d2a18 100644 --- a/src/compositor/extensions/qwaylandiviapplication.cpp +++ b/src/compositor/extensions/qwaylandiviapplication.cpp @@ -146,7 +146,7 @@ QByteArray QWaylandIviApplication::interfaceName() */ /*! - * \fn void QWaylandWlShell::iviSurfaceRequested(QWaylandSurface *surface, uint iviId, const QWaylandResource &resource) + * \fn void QWaylandIviApplication::iviSurfaceRequested(QWaylandSurface *surface, uint iviId, const QWaylandResource &resource) * * This signal is emitted when the client has requested an \c ivi_surface to be associated * with \a surface, which is identified by \a id. The handler for this signal is @@ -162,9 +162,9 @@ QByteArray QWaylandIviApplication::interfaceName() */ /*! - * \fn void QtWaylandCompositor::IviApplication::iviSurfaceCreated(QWaylandIviSurface *iviSurface) + * \fn void QWaylandIviApplication::iviSurfaceCreated(QWaylandIviSurface *iviSurface) * - * This signal is emitted when an IviSurface has been created. + * This signal is emitted when an IviSurface, \a iviSurface, has been created. */ QWaylandIviApplicationPrivate::QWaylandIviApplicationPrivate() diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index 36c579e95..4cdbb0a3a 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -633,11 +633,6 @@ QWaylandWlShell *QWaylandWlShellSurface::shell() const * This property holds the window type of the WlShellSurface. */ -/*! - * \property QWaylandWlShellSurface::windowType - * - * This property holds the window type of the QWaylandWlShellSurface. - */ Qt::WindowType QWaylandWlShellSurface::windowType() const { Q_D(const QWaylandWlShellSurface); diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index 8019afe00..b5db226c2 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -888,11 +888,11 @@ void QWaylandXdgSurfaceV5::initialize(QWaylandXdgShellV5 *xdgShell, QWaylandSurf * typically in response to the window decorations being dragged by \a seat on the window borders * given by \a edges. * - * \sa QWaylandXdgSurfaceV5::ResizeEdges + * \sa QWaylandXdgSurfaceV5::ResizeEdge */ /*! - * \fn void QWaylandXdgSurfaceV5::startResize(QWaylandSeat *seat, ResizeEdges edges) + * \fn void QWaylandXdgSurfaceV5::startResize(QWaylandSeat *seat, ResizeEdge edges) * * This signal is emitted when the client wants to start an interactive resize of the * QWaylandXdgSurfaceV5, typically in response to the window decorations being dragged by @@ -1048,11 +1048,6 @@ QWaylandSurface *QWaylandXdgSurfaceV5::surface() const * This property holds the window type of the XdgSurfaceV5. */ -/*! - * \property QWaylandXdgSurfaceV5::windowType - * - * This property holds the window type of the QWaylandXdgSurfaceV5. - */ Qt::WindowType QWaylandXdgSurfaceV5::windowType() const { Q_D(const QWaylandXdgSurfaceV5); -- cgit v1.2.3 From 98f38b01997ec59aa5040f839deb6f062f01be17 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 13 Oct 2017 15:44:09 +0200 Subject: Fix crash when opening a window with a hidden parent We have a transient parent but it doesn't have a shell surface. We need to make sure that it exists before setting the transient parent's shell surface as the parent to the window. Change-Id: I918b2f14074217638529ba73530f0102f7438079 Reviewed-by: David Edmundson Reviewed-by: Pier Luigi Fiorini --- src/client/qwaylandxdgshellv6.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp index cd81778c7..d9302ed57 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/client/qwaylandxdgshellv6.cpp @@ -169,7 +169,8 @@ void QWaylandXdgSurfaceV6::setType(Qt::WindowType type, QWaylandWindow *transien setToplevel(); if (transientParent) { auto parentXdgSurface = static_cast(transientParent->shellSurface()); - m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); + if (parentXdgSurface) + m_toplevel->set_parent(parentXdgSurface->m_toplevel->object()); } } } -- cgit v1.2.3 From 154bdf45dd51a521058c820e7b871008ce8508ae Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 14 Dec 2017 17:40:43 +0100 Subject: Fix for big memory leak in Qt based compositors The system would leak a complete buffer every time the client attached a new Wayland buffer. For QML applications this will normally happen every time a new animation is started. Change-Id: Ie4981ccbb2e09d702ee291f1144e3b8aa84c0d1d Reviewed-by: Paul Olav Tvete --- .../waylandeglclientbufferintegration.cpp | 29 +++++++++++++++++++++- .../waylandeglclientbufferintegration.h | 3 +++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index 453800c18..f5e63aec5 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -198,10 +198,14 @@ public: QEGLStreamConvenience *funcs; static WaylandEglClientBufferIntegrationPrivate *get(WaylandEglClientBufferIntegration *integration) { - return integration->d_ptr.data(); + return shuttingDown ? nullptr : integration->d_ptr.data(); } + + static bool shuttingDown; }; +bool WaylandEglClientBufferIntegrationPrivate::shuttingDown = false; + BufferState::BufferState() : egl_format(EGL_TEXTURE_RGBA) , egl_stream(EGL_NO_STREAM_KHR) @@ -395,6 +399,11 @@ WaylandEglClientBufferIntegration::WaylandEglClientBufferIntegration() { } +WaylandEglClientBufferIntegration::~WaylandEglClientBufferIntegration() +{ + WaylandEglClientBufferIntegrationPrivate::shuttingDown = true; +} + void WaylandEglClientBufferIntegration::initializeHardware(struct wl_display *display) { Q_D(WaylandEglClientBufferIntegration); @@ -480,6 +489,24 @@ WaylandEglClientBuffer::WaylandEglClientBuffer(WaylandEglClientBufferIntegration } } + +WaylandEglClientBuffer::~WaylandEglClientBuffer() +{ + auto *p = WaylandEglClientBufferIntegrationPrivate::get(m_integration); + + if (p) { + for (auto image : d->egl_images) + p->egl_destroy_image(p->egl_display, image); + + if (d->egl_stream) + p->funcs->destroy_stream(p->egl_display, d->egl_stream); + + for (auto *texture : d->textures) + delete texture; + } + delete d; +} + static QWaylandBufferRef::BufferFormatEgl formatFromEglFormat(EGLint format) { switch (format) { case EGL_TEXTURE_RGB: diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h index 5217039d8..60ce814de 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h @@ -53,6 +53,7 @@ class WaylandEglClientBufferIntegration : public QtWayland::ClientBufferIntegrat Q_DECLARE_PRIVATE(WaylandEglClientBufferIntegration) public: WaylandEglClientBufferIntegration(); + ~WaylandEglClientBufferIntegration(); void initializeHardware(struct ::wl_display *display) override; @@ -68,6 +69,8 @@ struct BufferState; class WaylandEglClientBuffer : public QtWayland::ClientBuffer { public: + ~WaylandEglClientBuffer(); + QWaylandBufferRef::BufferFormatEgl bufferFormatEgl() const override; QSize size() const override; QWaylandSurface::Origin origin() const override; -- cgit v1.2.3 From 718e8a018eda827797ea4568e9c40b221d4608e1 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 21 Nov 2017 10:13:43 +0100 Subject: Revert "Ref count buffer usage" When a buffer is committed multiple times, not all compositors (i.e. Weston) send a matching number of release events. This caused clients to freeze on some occasions on those compositors because they were waiting for a release event that never came. This reverts commit 5f38652cd52c03e9df8600f5f41e044820c3062c. Backport from 5.10.0 to 5.9.4 Task-number: QTBUG-64631 Reviewed-by: David Edmundson Reviewed-by: Paul Olav Tvete (cherry picked from commit 2767d0533f2901517c87d9c99bcda26564484280) Change-Id: I2acf5574a1b792d3bbf928fb0bc328aa8ee8ffe0 Reviewed-by: Johan Helsing --- src/client/qwaylandbuffer.cpp | 2 +- src/client/qwaylandbuffer_p.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp index 076a0d57d..a0fcc532f 100644 --- a/src/client/qwaylandbuffer.cpp +++ b/src/client/qwaylandbuffer.cpp @@ -66,7 +66,7 @@ void QWaylandBuffer::init(wl_buffer *buf) void QWaylandBuffer::release(void *data, wl_buffer *) { - static_cast(data)->mBusy--; + static_cast(data)->mBusy = false; } const wl_buffer_listener QWaylandBuffer::listener = { diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h index b3513d151..9e8cba2e4 100644 --- a/src/client/qwaylandbuffer_p.h +++ b/src/client/qwaylandbuffer_p.h @@ -73,14 +73,14 @@ public: virtual QSize size() const = 0; virtual int scale() const { return 1; } - void setBusy() { mBusy++; } - bool busy() const { return mBusy > 0; } + void setBusy() { mBusy = true; } + bool busy() const { return mBusy; } protected: struct wl_buffer *mBuffer; private: - int mBusy; + bool mBusy; static void release(void *data, wl_buffer *); static const wl_buffer_listener listener; -- cgit v1.2.3 From 583ce658c38700b22d93329634d676b288118da4 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 5 Jan 2018 12:44:30 +0100 Subject: Fix protocol error when destroying xdg surfaces (v6) Destroy role object for toplevels when destroying the xdg surface. Task-number: QTBUG-65568 Change-Id: Ibe027c3eef8160f9fd2cfb05971c92ceb155f95b Reviewed-by: David Edmundson Reviewed-by: Pier Luigi Fiorini --- src/client/qwaylandxdgshellv6.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp index cd81778c7..7473174d1 100644 --- a/src/client/qwaylandxdgshellv6.cpp +++ b/src/client/qwaylandxdgshellv6.cpp @@ -125,6 +125,8 @@ QWaylandXdgSurfaceV6::QWaylandXdgSurfaceV6(QWaylandXdgShellV6 *shell, ::zxdg_sur QWaylandXdgSurfaceV6::~QWaylandXdgSurfaceV6() { + if (m_toplevel) + zxdg_toplevel_v6_destroy(m_toplevel->object()); if (m_popup) zxdg_popup_v6_destroy(m_popup->object()); destroy(); -- cgit v1.2.3 From 83db09bd0acaafb256880e3a217ed9df0641a00a Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 16 Jan 2018 12:02:30 +0100 Subject: Fix static builds with libwayland-egl There was a naming conflict between the client buffer integration, wayland-egl, and the system library libwayland-egl.so Rename the plugin binary to qt-plugin-wayland-egl to avoid the issue. Task-number: QTBUG-65652 Change-Id: Ib074c25e269a5e11b087fb4c3ddb15fef7d4a7ee Reviewed-by: Paul Olav Tvete --- src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro b/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro index d85c5efaa..409cd37d7 100644 --- a/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro +++ b/src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro @@ -7,6 +7,8 @@ OTHER_FILES += \ SOURCES += main.cpp +TARGET = qt-plugin-wayland-egl + PLUGIN_TYPE = wayland-graphics-integration-client PLUGIN_CLASS_NAME = QWaylandEglClientBufferPlugin load(qt_plugin) -- cgit v1.2.3 From bf09c7a1493c01a65ee0f110b37a04e653edc08e Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Wed, 3 Jan 2018 19:18:42 +0000 Subject: Don't recreate hidden egl surfaces QWaylandEglWindow deletes surfaces when a window changes from hidden to visible, presumably as a result of us not having a valid wl_surface object. By extension it doesn't make sense to create a surface whilst a window is still hidden. This fixes a crash where a QQuickWindow hides and then is destroyed. In QQuickWindow destruction we have to create a valid context in order to delete any textures/assets owned by the scene graph; as the wl_surface has gone this causes an error in the EGL libs when we create an EGL surface. Task-number: QTBUG-65553 Change-Id: I9b37a86326bf2cd7737c4e839c1aa8c74cf08116 Reviewed-by: Johan Helsing --- src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 2a9e39ed6..f4dd6f492 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp @@ -407,7 +407,7 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface) window->createDecoration(); if (eglSurface == EGL_NO_SURFACE) { - window->updateSurface(true); + window->updateSurface(window->isExposed()); eglSurface = window->eglSurface(); } -- cgit v1.2.3 From 6793a0a907f3aa92f8f8bd5448505c152d0e3a3d Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 8 Jan 2018 13:30:51 +0100 Subject: Fix requestUpdate() After commit 3e745ea053e42ba087438203df3bd76b30a08eb2, mFrameCallback is set to null when the next buffer is attached, not when the callback arrives. This means that a requestUpdate() after the frame callback would never be delivered. The solution is to test mWaitingForFrameSync instead. There is still a small race condition, but the failure case is that the update will arrive after 5 ms instead of exactly at frame sync. Change-Id: I413ed2b76c8527f825e501077bab712146b6705f Reviewed-by: Johan Helsing --- src/client/qwaylandwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 6d7c0885c..d98708100 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -1029,7 +1029,7 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa void QWaylandWindow::requestUpdate() { - if (!mFrameCallback) + if (!mWaitingForFrameSync) QPlatformWindow::requestUpdate(); else mUpdateRequested = true; -- cgit v1.2.3