diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2018-01-30 10:37:24 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2018-01-31 10:29:53 +0100 |
commit | 6c1499b227324e29cece5651fa00c812d9e01709 (patch) | |
tree | db9ce6e6bc8c605bd54514954b91b73834249b6f /src | |
parent | 7a9d0f9d0a852c727aef5a54ceeb51b7b2dda85d (diff) | |
parent | 06230d22488796d92ea130e985d1e0ee2ed05199 (diff) |
Merge remote-tracking branch 'qt/5.10' into dev
Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
Diffstat (limited to 'src')
18 files changed, 127 insertions, 85 deletions
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) |