summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2018-01-30 10:37:24 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2018-01-31 10:29:53 +0100
commit6c1499b227324e29cece5651fa00c812d9e01709 (patch)
treedb9ce6e6bc8c605bd54514954b91b73834249b6f
parent7a9d0f9d0a852c727aef5a54ceeb51b7b2dda85d (diff)
parent06230d22488796d92ea130e985d1e0ee2ed05199 (diff)
Merge remote-tracking branch 'qt/5.10' into dev
-rw-r--r--dist/changes-5.10.041
-rw-r--r--dist/changes-5.9.352
-rw-r--r--dist/changes-5.9.435
-rw-r--r--src/client/qwaylandbuffer.cpp2
-rw-r--r--src/client/qwaylandbuffer_p.h6
-rw-r--r--src/client/qwaylandwindow.cpp2
-rw-r--r--src/client/qwaylandxdgshellv6.cpp5
-rw-r--r--src/compositor/compositor_api/qwaylandclient.cpp2
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp65
-rw-r--r--src/compositor/compositor_api/qwaylandoutput.cpp2
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp44
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.cpp4
-rw-r--r--src/compositor/extensions/qwaylandiviapplication.cpp10
-rw-r--r--src/compositor/extensions/qwaylandivisurface.cpp4
-rw-r--r--src/compositor/extensions/qwaylandwlshell.cpp9
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.cpp19
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp2
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri2
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp29
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h3
-rw-r--r--src/plugins/hardwareintegration/client/wayland-egl/wayland-egl.pro2
-rw-r--r--tests/auto/client/client/tst_client.cpp76
-rw-r--r--tests/auto/client/shared/mockinput.cpp8
-rw-r--r--tests/auto/client/shared/shared.pri1
-rw-r--r--tests/auto/compositor/compositor/compositor.pro2
25 files changed, 323 insertions, 104 deletions
diff --git a/dist/changes-5.10.0 b/dist/changes-5.10.0
new file mode 100644
index 000000000..8805b45fe
--- /dev/null
+++ b/dist/changes-5.10.0
@@ -0,0 +1,41 @@
+Qt 5.10 introduces many new features and improvements as well as bugfixes
+over the 5.9.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.10 series is binary compatible with the 5.9.x series.
+Applications compiled for 5.9 will continue to run with 5.10.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Qt Wayland QPA Plugin 5.10.0 Changes *
+****************************************************************************
+
+ - [QTBUG-58423] Make sure wl_surface exists when SurfaceCreated is sent.
+
+ - Set QScreen product information.
+
+ - Shared memory buffers are now created in a thread safe manner,
+ and are simple memory buffers that do not exist on disk.
+
+****************************************************************************
+* Qt Wayland Compositor API 5.10.0 Changes *
+****************************************************************************
+
+ - [QTBUG-56174] Add support for xdg-shell-unstable-v6.
+
+
+****************************************************************************
+* Qt Wayland 5.10.0 General Changes *
+****************************************************************************
+
+- The server buffer integration has been updated to be more stable, and
+ the (private) API is now more usable.
diff --git a/dist/changes-5.9.3 b/dist/changes-5.9.3
new file mode 100644
index 000000000..ba81445c0
--- /dev/null
+++ b/dist/changes-5.9.3
@@ -0,0 +1,52 @@
+Qt 5.9.3 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.9.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.9 series is binary compatible with the 5.8.x series.
+Applications compiled for 5.8 will continue to run with 5.9. Exception:
+between Qt 5.8.0 and 5.9.0 the QWaylandQuickOutput class was changed
+in a binary incompatible way.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+
+****************************************************************************
+* Qt Wayland QPA Plugin 5.9.3 Changes *
+****************************************************************************
+
+ - Fix crash when wl-shell setType is called with a hidden parent.
+
+ - [QTBUG-63840] Fix crash with XDG shell v6 when parent of popup is not
+ initialized.
+
+ - Fix flickering if backing store is flushed multiple times between paints.
+
+****************************************************************************
+* Qt Wayland Compositor API 5.9.3 Changes *
+****************************************************************************
+
+- [QTBUG-63208] Fix crash after destroying view with mouse focus
+
+- [QTBUG-63039] Make multi-threaded QML compositors work with Nvidia
+ EGLStreams. Note: this requires setting the Qt::AA_ShareOpenGLContexts
+ application attribute.
+
+- Add missing signals for properties:
+ * QWaylandSurface::cursorSurfaceChanged
+ * QWaylandOutput::windowChanged
+ * QWaylandOutput::geometryChanged
+ * QWaylandOutput::availableGeometryChanged
+ * QWaylandCompositor::socketNameChanged
+
+- [QTBUG-62638] Make sure mask is applied when window is reset.
+
diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4
new file mode 100644
index 000000000..70a2f54db
--- /dev/null
+++ b/dist/changes-5.9.4
@@ -0,0 +1,35 @@
+Qt 5.9.4 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.9.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.9 series is binary compatible with the 5.8.x series.
+Applications compiled for 5.8 will continue to run with 5.9. Exception:
+between Qt 5.8.0 and 5.9.0 the QWaylandQuickOutput class was changed
+in a binary incompatible way.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+
+****************************************************************************
+* Qt Wayland QPA Plugin 5.9.4 Changes *
+****************************************************************************
+
+ - [QTBUG-64631] Fix freeze on resize with Weston and Qt Wayland Compositors
+
+****************************************************************************
+* Qt Wayland Compositor API 5.9.4 Changes *
+****************************************************************************
+
+ - Fix memory leak when client attached a new Wayland buffer.
+
+ - [QTBUG-64841] Fix decoding of multi-planar surfaces (YUV video)
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<QWaylandBuffer *>(data)->mBusy--;
+ static_cast<QWaylandBuffer *>(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;
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 28e57be5f..2e709440f 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -1050,7 +1050,7 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa
void QWaylandWindow::requestUpdate()
{
- if (!mFrameCallback)
+ if (!mWaitingForFrameSync)
QPlatformWindow::requestUpdate();
else
mUpdateRequested = true;
diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp
index cd81778c7..1a60d6533 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();
@@ -169,7 +171,8 @@ void QWaylandXdgSurfaceV6::setType(Qt::WindowType type, QWaylandWindow *transien
setToplevel();
if (transientParent) {
auto parentXdgSurface = static_cast<QWaylandXdgSurfaceV6 *>(transientParent->shellSurface());
- m_toplevel->set_parent(parentXdgSurface->m_toplevel->object());
+ if (parentXdgSurface)
+ m_toplevel->set_parent(parentXdgSurface->m_toplevel->object());
}
}
}
diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp
index cdabb6a91..122fd41c3 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 ea90e6cdc..4c662a34a 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(object 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);
@@ -465,6 +432,38 @@ void QWaylandCompositorPrivate::loadServerBufferIntegration()
*/
/*!
+ \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.
*/
QWaylandCompositor::QWaylandCompositor(QObject *parent)
diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp
index f57b8bb53..9cbf80fd3 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/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index ed4492038..de5a36cdb 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -221,15 +221,15 @@ void QWaylandBufferMaterial::bind()
switch (m_textures.size()) {
case 3:
if (m_textures[2])
- m_textures[2]->bind(GL_TEXTURE2);
+ m_textures[2]->bind(2);
Q_FALLTHROUGH();
case 2:
if (m_textures[1])
- m_textures[1]->bind(GL_TEXTURE1);
+ m_textures[1]->bind(1);
Q_FALLTHROUGH();
case 1:
if (m_textures[0])
- m_textures[0]->bind(GL_TEXTURE0);
+ m_textures[0]->bind(0);
}
}
@@ -388,15 +388,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
{
@@ -817,7 +809,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
@@ -1172,6 +1164,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);
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp
index 34b093d21..37b6876ac 100644
--- a/src/compositor/compositor_api/qwaylandsurface.cpp
+++ b/src/compositor/compositor_api/qwaylandsurface.cpp
@@ -409,7 +409,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.
@@ -887,7 +887,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..8295d2a18 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
@@ -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
@@ -155,16 +155,16 @@ 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.
*/
/*!
- * \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/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 00a5a1272..c588c1063 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.
*/
/*!
@@ -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 c0cb4f8e4..b5db226c2 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.
*/
/*!
@@ -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);
@@ -1367,10 +1362,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.
*/
/*!
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 61cc9d468..967028861 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();
}
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
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index f39a7ce71..fdaddb6ab 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;
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)
diff --git a/tests/auto/client/client/tst_client.cpp b/tests/auto/client/client/tst_client.cpp
index 3cf19546f..94198b457 100644
--- a/tests/auto/client/client/tst_client.cpp
+++ b/tests/auto/client/client/tst_client.cpp
@@ -35,8 +35,12 @@
#include <QMimeData>
#include <QPixmap>
#include <QDrag>
+#include <QWindow>
+#include <QOpenGLWindow>
#include <QtTest/QtTest>
+#include <QtWaylandClient/private/qwaylandintegration_p.h>
+#include <QtGui/private/qguiapplication_p.h>
static const QSize screenSize(1600, 1200);
@@ -97,6 +101,8 @@ public:
++touchEventCount;
}
+ QPoint frameOffset() const { return QPoint(frameMargins().left(), frameMargins().top()); }
+
int focusInEventCount;
int focusOutEventCount;
int keyPressEventCount;
@@ -109,6 +115,25 @@ public:
QPoint mousePressPos;
};
+class TestGlWindow : public QOpenGLWindow
+{
+ Q_OBJECT
+
+public:
+ TestGlWindow();
+
+protected:
+ void paintGL() override;
+};
+
+TestGlWindow::TestGlWindow()
+{}
+
+void TestGlWindow::paintGL()
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+}
+
class tst_WaylandClient : public QObject
{
Q_OBJECT
@@ -149,6 +174,7 @@ private slots:
void dontCrashOnMultipleCommits();
void hiddenTransientParent();
void hiddenPopupParent();
+ void glWindow();
private:
MockCompositor *compositor;
@@ -235,7 +261,7 @@ void tst_WaylandClient::removePrimaryScreen()
compositor->sendRemoveOutput(firstOutput);
QTRY_COMPARE(QGuiApplication::screens().size(), 1);
- compositor->sendMousePress(surface, QPoint(10, 10));
+ compositor->sendMousePress(surface, window.frameOffset() + QPoint(10, 10));
QTRY_COMPARE(window.mousePressEventCount, 1);
compositor->sendMouseRelease(surface);
QTRY_COMPARE(window.mouseReleaseEventCount, 1);
@@ -290,7 +316,7 @@ void tst_WaylandClient::events()
QPoint mousePressPos(16, 16);
QCOMPARE(window.mousePressEventCount, 0);
- compositor->sendMousePress(surface, mousePressPos);
+ compositor->sendMousePress(surface, window.frameOffset() + mousePressPos);
QTRY_COMPARE(window.mousePressEventCount, 1);
QTRY_COMPARE(window.mousePressPos, mousePressPos);
@@ -299,7 +325,7 @@ void tst_WaylandClient::events()
QTRY_COMPARE(window.mouseReleaseEventCount, 1);
const int touchId = 0;
- compositor->sendTouchDown(surface, QPoint(10, 10), touchId);
+ compositor->sendTouchDown(surface, window.frameOffset() + QPoint(10, 10), touchId);
compositor->sendTouchFrame(surface);
QTRY_COMPARE(window.touchEventCount, 1);
@@ -358,6 +384,7 @@ public:
m_dragIcon = QPixmap::fromImage(cursorImage);
}
~DndWindow(){}
+ QPoint frameOffset() const { return QPoint(frameMargins().left(), frameMargins().top()); }
bool dragStarted;
protected:
@@ -392,14 +419,14 @@ void tst_WaylandClient::touchDrag()
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
const int id = 0;
- compositor->sendTouchDown(surface, QPoint(10, 10), id);
+ compositor->sendTouchDown(surface, window.frameOffset() + QPoint(10, 10), id);
compositor->sendTouchFrame(surface);
- compositor->sendTouchMotion(surface, QPoint(20, 20), id);
+ compositor->sendTouchMotion(surface, window.frameOffset() + QPoint(20, 20), id);
compositor->sendTouchFrame(surface);
compositor->waitForStartDrag();
compositor->sendDataDeviceDataOffer(surface);
- compositor->sendDataDeviceEnter(surface, QPoint(20, 20));
- compositor->sendDataDeviceMotion( QPoint(21, 21));
+ compositor->sendDataDeviceEnter(surface, window.frameOffset() + QPoint(20, 20));
+ compositor->sendDataDeviceMotion(window.frameOffset() + QPoint(21, 21));
compositor->sendDataDeviceDrop(surface);
compositor->sendDataDeviceLeave(surface);
QTRY_VERIFY(window.dragStarted);
@@ -416,10 +443,10 @@ void tst_WaylandClient::mouseDrag()
compositor->setKeyboardFocus(surface);
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
- compositor->sendMousePress(surface, QPoint(10, 10));
+ compositor->sendMousePress(surface, window.frameOffset() + QPoint(10, 10));
compositor->sendDataDeviceDataOffer(surface);
- compositor->sendDataDeviceEnter(surface, QPoint(20, 20));
- compositor->sendDataDeviceMotion( QPoint(21, 21));
+ compositor->sendDataDeviceEnter(surface, window.frameOffset() + QPoint(20, 20));
+ compositor->sendDataDeviceMotion(window.frameOffset() + QPoint(21, 21));
compositor->waitForStartDrag();
compositor->sendDataDeviceDrop(surface);
compositor->sendDataDeviceLeave(surface);
@@ -480,7 +507,7 @@ void tst_WaylandClient::hiddenPopupParent()
QTRY_VERIFY(surface = compositor->surface());
QPoint mousePressPos(16, 16);
QCOMPARE(toplevel.mousePressEventCount, 0);
- compositor->sendMousePress(surface, mousePressPos);
+ compositor->sendMousePress(surface, toplevel.frameOffset() + mousePressPos);
QTRY_COMPARE(toplevel.mousePressEventCount, 1);
QWindow popup;
@@ -494,20 +521,37 @@ void tst_WaylandClient::hiddenPopupParent()
QTRY_VERIFY(compositor->surface());
}
+void tst_WaylandClient::glWindow()
+{
+ QSKIP("Skipping GL tests, as not supported by all CI systems: See https://bugreports.qt.io/browse/QTBUG-65802");
+
+ QScopedPointer<TestGlWindow> testWindow(new TestGlWindow);
+ testWindow->show();
+ QSharedPointer<MockSurface> surface;
+ QTRY_VERIFY(surface = compositor->surface());
+
+ //confirm we don't crash when we delete an already hidden GL window
+ //QTBUG-65553
+ testWindow->setVisible(false);
+ QTRY_VERIFY(!compositor->surface());
+}
+
int main(int argc, char **argv)
{
setenv("XDG_RUNTIME_DIR", ".", 1);
setenv("QT_QPA_PLATFORM", "wayland", 1); // force QGuiApplication to use wayland plugin
- // wayland-egl hangs in the test setup when we try to initialize. Until it gets
- // figured out, avoid clientBufferIntegration() from being called in
- // QWaylandWindow::createDecorations().
- setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1);
-
MockCompositor compositor;
compositor.setOutputMode(screenSize);
QGuiApplication app(argc, argv);
+
+ // Initializing some client buffer integrations (i.e. eglInitialize) may block while waiting
+ // for a wayland sync. So we call clientBufferIntegration prior to applicationInitialized
+ // (while the compositor processes events without waiting) in order to avoid hanging later.
+ auto *waylandIntegration = static_cast<QtWaylandClient::QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ waylandIntegration->clientBufferIntegration();
+
compositor.applicationInitialized();
tst_WaylandClient tc(&compositor);
diff --git a/tests/auto/client/shared/mockinput.cpp b/tests/auto/client/shared/mockinput.cpp
index 3e7b294b4..9cea85b6d 100644
--- a/tests/auto/client/shared/mockinput.cpp
+++ b/tests/auto/client/shared/mockinput.cpp
@@ -360,7 +360,9 @@ void Touch::sendDown(Surface *surface, const QPoint &position, int id)
Q_ASSERT(surface);
Resource *resource = resourceMap().value(surface->resource()->client());
Q_ASSERT(resource);
- wl_touch_send_down(resource->handle, serial, time, surface->resource()->handle, id, position.x(), position.y());
+ auto x = wl_fixed_from_int(position.x());
+ auto y = wl_fixed_from_int(position.y());
+ wl_touch_send_down(resource->handle, serial, time, surface->resource()->handle, id, x, y);
}
void Touch::sendUp(Surface *surface, int id)
@@ -373,7 +375,9 @@ void Touch::sendMotion(Surface *surface, const QPoint &position, int id)
{
Resource *resource = resourceMap().value(surface->resource()->client());
uint32_t time = m_compositor->time();
- wl_touch_send_motion(resource->handle, time, id, position.x(), position.y());
+ auto x = wl_fixed_from_int(position.x());
+ auto y = wl_fixed_from_int(position.y());
+ wl_touch_send_motion(resource->handle, time, id, x, y);
}
void Touch::sendFrame(Surface *surface)
diff --git a/tests/auto/client/shared/shared.pri b/tests/auto/client/shared/shared.pri
index 7b0382efc..608664bb7 100644
--- a/tests/auto/client/shared/shared.pri
+++ b/tests/auto/client/shared/shared.pri
@@ -1,5 +1,6 @@
CONFIG += testcase link_pkgconfig
QT += testlib
+QT += core-private gui-private waylandclient-private
QMAKE_USE += wayland-client wayland-server
diff --git a/tests/auto/compositor/compositor/compositor.pro b/tests/auto/compositor/compositor/compositor.pro
index 112e2e74f..2919fa4bb 100644
--- a/tests/auto/compositor/compositor/compositor.pro
+++ b/tests/auto/compositor/compositor/compositor.pro
@@ -7,7 +7,7 @@ QT += core-private gui-private waylandcompositor waylandcompositor-private
QMAKE_USE += wayland-client wayland-server
-qtConfig(xkbcommon-evdev)
+qtConfig(xkbcommon-evdev): \
QMAKE_USE += xkbcommon_evdev
WAYLANDCLIENTSOURCES += \