From d4f67d8414b8ddac8fb4bd3d70ae65e20a818645 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 21 Sep 2017 13:51:08 +0200 Subject: Make minimal-cpp work with EGLStreams Redo change 955ac0d0eeaf2f543676b649291558f4dcce37c3 for the minimal compositor example. EGL_KHR_stream_consumer_gltexture only allows connecting to the texture bound to GL_TEXTURE_EXTERNAL_OES, meaning that assumptions about the target always being GL_TEXTURE_2D break horribly. Change-Id: If5b21d740eb80486e4f55bee843a820f0b0edd60 Reviewed-by: Laszlo Agocs --- examples/wayland/minimal-cpp/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp index 68f206fcf..893371832 100644 --- a/examples/wayland/minimal-cpp/window.cpp +++ b/examples/wayland/minimal-cpp/window.cpp @@ -85,7 +85,8 @@ void Window::paintGL() functions->glClearColor(.4f, .7f, .1f, 0.5f); functions->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - m_textureBlitter.bind(); + GLenum currentTarget = GL_TEXTURE_2D; + m_textureBlitter.bind(currentTarget); functions->glEnable(GL_BLEND); functions->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -97,6 +98,10 @@ void Window::paintGL() auto texture = view->getTexture(); if (!texture) continue; + if (texture->target() != currentTarget) { + currentTarget = texture->target(); + m_textureBlitter.bind(currentTarget); + } GLuint textureId = texture->textureId(); QWaylandSurface *surface = view->surface(); if (surface && surface->hasContent()) { -- cgit v1.2.3 From dbe33b1745d0fe5c553abaf841e045fa059ada1b Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 15:55:05 +0200 Subject: The ping method belongs to XdgShellV5, not XdgSurface Change-Id: I9f2ed6411ab0e24a2a6e6f194abe3ffaaba96756 Reviewed-by: Pier Luigi Fiorini --- src/compositor/extensions/qwaylandxdgshellv5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index dfb65a2f3..7ba1b4f43 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -608,7 +608,7 @@ QByteArray QWaylandXdgShellV5::interfaceName() } /*! - * \qmlmethod void QtWaylandCompositor::XdgSurface::ping() + * \qmlmethod void QtWaylandCompositor::XdgShellV5::ping() * * Sends a ping event to the \a client. If the client replies to the event, the * pong signal will be emitted. -- cgit v1.2.3 From 1d6a50071953288e0d008af7773d9207c9f9404a Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 15:56:55 +0200 Subject: Documentation: Fix missing renames from Xdg* to Xdg*V5 Change-Id: Ia60e20a15151a76c337872bf46b4d09da519387c Reviewed-by: Pier Luigi Fiorini --- src/compositor/extensions/qwaylandxdgshellv5.cpp | 52 +++++++++++----------- src/compositor/extensions/qwaylandxdgshellv5.h | 2 +- src/compositor/extensions/qwaylandxdgshellv5_p.h | 2 +- .../extensions/qwaylandxdgshellv5integration_p.h | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index 7ba1b4f43..8f1164260 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.cpp +++ b/src/compositor/extensions/qwaylandxdgshellv5.cpp @@ -701,14 +701,14 @@ void QWaylandXdgShellV5::handleFocusChanged(QWaylandSurface *newSurface, QWaylan */ /*! - * \qmlsignal QtWaylandCompositor::XdgSurface::setTopLevel() + * \qmlsignal QtWaylandCompositor::XdgSurfaceV5::setTopLevel() * * This signal is emitted when the parent surface is unset, effectively * making the window top level. */ /*! - * \qmlsignal QtWaylandCompositor::XdgSurface::setTransient() + * \qmlsignal QtWaylandCompositor::XdgSurfaceV5::setTransient() * * This signal is emitted when the parent surface is set, effectively * making the window transient. @@ -733,9 +733,9 @@ QWaylandXdgSurfaceV5::QWaylandXdgSurfaceV5(QWaylandXdgShellV5 *xdgShell, QWaylan } /*! - * \qmlmethod void QtWaylandCompositor::XdgSurface::initialize(object surface, object client, int id) + * \qmlmethod void QtWaylandCompositor::XdgSurfaceV5::initialize(object surface, object client, int id) * - * Initializes the XdgSurface, associating it with the given \a surface, + * Initializes the XdgSurfaceV5, associating it with the given \a surface, * \a client, and \a id. */ @@ -789,9 +789,9 @@ void QWaylandXdgSurfaceV5::handleBufferScaleChanged() } /*! - * \qmlproperty object QtWaylandCompositor::XdgSurface::shell + * \qmlproperty object QtWaylandCompositor::XdgSurfaceV5::shell * - * This property holds the shell associated with this XdgSurface. + * This property holds the shell associated with this XdgSurfaceV5. */ /*! @@ -806,9 +806,9 @@ QWaylandXdgShellV5 *QWaylandXdgSurfaceV5::shell() const } /*! - * \qmlproperty object QtWaylandCompositor::XdgSurface::surface + * \qmlproperty object QtWaylandCompositor::XdgSurfaceV5::surface * - * This property holds the surface associated with this XdgSurface. + * This property holds the surface associated with this XdgSurfaceV5. */ /*! @@ -840,20 +840,20 @@ Qt::WindowType QWaylandXdgSurfaceV5::windowType() const } /*! - * \qmlproperty object QtWaylandCompositor::XdgSurface::parentSurface + * \qmlproperty object QtWaylandCompositor::XdgSurfaceV5::parentSurface * - * This property holds the XdgSurface parent of this XdgSurface. + * This property holds the XdgSurfaceV5 parent of this XdgSurfaceV5. * When a parent surface is set, the parentSurfaceChanged() signal * is guaranteed to be emitted before setTopLevel() and setTransient(). * - * \sa QtWaylandCompositor::XdgSurface::setTopLevel() - * \sa QtWaylandCompositor::XdgSurface::setTransient() + * \sa QtWaylandCompositor::XdgSurfaceV5::setTopLevel() + * \sa QtWaylandCompositor::XdgSurfaceV5::setTransient() */ /*! * \property QWaylandXdgSurfaceV5::parentSurface * - * This property holds the XdgSurface parent of this XdgSurface. + * This property holds the XdgSurfaceV5 parent of this XdgSurfaceV5. * When a parent surface is set, the parentSurfaceChanged() signal * is guaranteed to be emitted before setTopLevel() and setTransient(). * @@ -867,9 +867,9 @@ QWaylandXdgSurfaceV5 *QWaylandXdgSurfaceV5::parentSurface() const } /*! - * \qmlproperty string QtWaylandCompositor::XdgSurface::title + * \qmlproperty string QtWaylandCompositor::XdgSurfaceV5::title * - * This property holds the title of the XdgSurface. + * This property holds the title of the XdgSurfaceV5. */ /*! @@ -995,10 +995,10 @@ QSize QWaylandXdgSurfaceV5::sizeForResize(const QSizeF &size, const QPointF &del } /*! - * \qmlmethod int QtWaylandCompositor::XdgSurface::sendConfigure(size size, list states) + * \qmlmethod int QtWaylandCompositor::XdgSurfaceV5::sendConfigure(size size, list states) * * Sends a configure event to the client. \a size contains the pixel size of the surface. - * Known \a states are enumerated in XdgSurface::State. + * Known \a states are enumerated in XdgSurfaceV5::State. */ /*! @@ -1029,7 +1029,7 @@ uint QWaylandXdgSurfaceV5::sendConfigure(const QSize &size, const QVector Date: Wed, 27 Sep 2017 16:09:03 +0200 Subject: Compositor: Add missing cursorSurfaceChanged signal Change-Id: I23a67b8189ab84e6a70c9e3de5da15cf2e9a9d77 Reviewed-by: Paul Olav Tvete --- src/compositor/compositor_api/qwaylandsurface.cpp | 4 ++++ src/compositor/compositor_api/qwaylandsurface.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 6a6d65206..6f277dd96 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -666,7 +666,11 @@ bool QWaylandSurface::isDestroyed() const void QWaylandSurface::markAsCursorSurface(bool cursorSurface) { Q_D(QWaylandSurface); + if (d->isCursorSurface == cursorSurface) + return; + d->isCursorSurface = cursorSurface; + emit cursorSurfaceChanged(); } bool QWaylandSurface::isCursorSurface() const diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index a2186491b..010f279af 100644 --- a/src/compositor/compositor_api/qwaylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -86,7 +86,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandSurface : public QWaylandObject Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged) Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged) Q_PROPERTY(bool hasContent READ hasContent NOTIFY hasContentChanged) - Q_PROPERTY(bool cursorSurface READ isCursorSurface WRITE markAsCursorSurface) + Q_PROPERTY(bool cursorSurface READ isCursorSurface WRITE markAsCursorSurface NOTIFY cursorSurfaceChanged) public: enum Origin { @@ -165,6 +165,7 @@ Q_SIGNALS: void subsurfacePlaceAbove(QWaylandSurface *sibling); void subsurfacePlaceBelow(QWaylandSurface *sibling); void dragStarted(QWaylandDrag *drag); + void cursorSurfaceChanged(); void configure(bool hasBuffer); void redraw(); -- cgit v1.2.3 From dd584b2cf2060434b4bfca7940905612cfd4a2a9 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 12:46:24 +0200 Subject: Prevent '* * *' from appearing in WaylandView documentation The documentation was missing the proper indentation. Change-Id: I3ce2afd8b9ea8c045f54202f942a8f55f831c1b2 Reviewed-by: Venugopal Shivashankar --- src/compositor/compositor_api/qwaylandview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/compositor/compositor_api/qwaylandview.cpp b/src/compositor/compositor_api/qwaylandview.cpp index 1ce923d48..f56cb0b8e 100644 --- a/src/compositor/compositor_api/qwaylandview.cpp +++ b/src/compositor/compositor_api/qwaylandview.cpp @@ -118,10 +118,11 @@ QObject *QWaylandView::renderObject() const return d->renderObject; } /*! -* \qmlproperty object QtWaylandCompositor::WaylandView::surface -* -* This property holds the surface viewed by this WaylandView. -*/ + * \qmlproperty object QtWaylandCompositor::WaylandView::surface + * + * This property holds the surface viewed by this WaylandView. + */ + /*! * \property QWaylandView::surface * -- cgit v1.2.3 From 186eddb7fba58a64e8ce2a3d27847c45ae3b3ab0 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 8 Aug 2017 11:39:35 +0200 Subject: Update documentation for QWaylandQuickShellSurfaceItem Change-Id: I80b4f078d63ac32d9ce6d91fc46f0b9d9d7d7146 Reviewed-by: Paolo Angelelli Reviewed-by: Venugopal Shivashankar --- .../extensions/qwaylandquickshellsurfaceitem.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp index 9f6510476..e5443d468 100644 --- a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp +++ b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp @@ -50,12 +50,12 @@ QT_BEGIN_NAMESPACE * \inherits WaylandQuickItem * \inqmlmodule QtWayland.Compositor * \since 5.8 - * \brief A Qt Quick item type representing a WlShellSurface. + * \brief A Qt Quick item type for displaying and interacting with a ShellSurface. * - * This type is used to render \c wl_shell or \c xdg_shell surfaces as part of a Qt Quick - * scene. It handles moving and resizing triggered by clicking on the window decorations. + * This type is used to render \c wl_shell, \c xdg_shell or \c ivi_application surfaces as part of + * a Qt Quick scene. It handles moving and resizing triggered by clicking on the window decorations. * - * \sa WaylandQuickItem + * \sa WaylandQuickItem, WlShellSurface, XdgSurfaceV5, IviSurface */ /*! @@ -64,10 +64,10 @@ QT_BEGIN_NAMESPACE * \since 5.8 * \brief The QWaylandQuickShellSurfaceItem class provides a Qt Quick item that represents a QWaylandShellSurface. * - * This class is used to render \c wl_shell or \c xdg_shell surfaces as part of a Qt Quick - * scene. It handles moving and resizing triggered by clicking on the window decorations. + * This class is used to render \c wl_shell, \c xdg_shell or \c ivi_application surfaces as part of + * a Qt Quick scene. It handles moving and resizing triggered by clicking on the window decorations. * - * \sa QWaylandQuickItem + * \sa QWaylandQuickItem, QWaylandWlShellSurface, QWaylandXdgSurfaceV5, QWaylandIviSurface */ /*! -- cgit v1.2.3 From 5dd7edb860efb1ebfc573ce3f3391e49d7a0eaad Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 11:22:18 +0200 Subject: Add QML documentation for WaylandSeat Change-Id: I71f6714f2ac4d92baedd89246d57f20c159bda1b Reviewed-by: Venugopal Shivashankar --- src/compositor/compositor_api/qwaylandseat.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 60a9c60d2..80b75d617 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -153,6 +153,17 @@ void QWaylandSeatPrivate::seat_get_touch(wl_seat::Resource *resource, uint32_t i } } +/*! + * \qmltype WaylandSeat + * \inqmlmodule QtWayland.Compositor + * \since 5.8 + * \brief Provides access to keyboard, mouse, and touch input. + * + * The WaylandSeat type provides access to different types of user input and maintains + * a keyboard focus and a mouse pointer. It corresponds to the wl_seat interface in the Wayland + * protocol. + */ + /*! * \class QWaylandSeat * \inmodule QtWaylandCompositor -- cgit v1.2.3 From 522df31c8b04ace8cfec8a7fdc4e0df6f8567a0c Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 11:24:54 +0200 Subject: Remove duplicate QML documentation of Shell.focusPolicy Change-Id: I6c972b79555d41cba9e8c5954e595f76b580725b Reviewed-by: Venugopal Shivashankar --- src/compositor/extensions/qwaylandshell.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp index 836407d36..adb5827d4 100644 --- a/src/compositor/extensions/qwaylandshell.cpp +++ b/src/compositor/extensions/qwaylandshell.cpp @@ -57,12 +57,6 @@ QWaylandShell::QWaylandShell(QWaylandObject *waylandObject) { } -/*! - * \qmlproperty enum QtWaylandCompositor::Shell::focusPolicy - * - * This property holds the focus policy of the Shell. - */ - /*! * \enum QWaylandShell::FocusPolicy * @@ -73,7 +67,7 @@ QWaylandShell::QWaylandShell(QWaylandObject *waylandObject) */ /*! - * \qmlproperty object QtWaylandCompositor::Shell::focusPolicy + * \qmlproperty enumeration QtWaylandCompositor::Shell::focusPolicy * * This property holds the focus policy of the Shell. */ -- cgit v1.2.3 From a951b854823a1fb33f27fc04f5bd020dd937f5b5 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 12:12:53 +0200 Subject: Add missing documentation for IviApplication Change-Id: I7f958175fdb5ae21babae259bf2e8d5e749cd396 Reviewed-by: Venugopal Shivashankar --- .../extensions/qwaylandiviapplication.cpp | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index d1e87dcc4..d04662447 100644 --- a/src/compositor/extensions/qwaylandiviapplication.cpp +++ b/src/compositor/extensions/qwaylandiviapplication.cpp @@ -47,6 +47,49 @@ QT_BEGIN_NAMESPACE +/*! + * \qmltype IviApplication + * \inqmlmodule QtWayland.Compositor + * \since 5.8 + * \brief Provides a shell extension for embedded-style user interfaces. + * + * The IviApplication extension provides a way to associate an IviSurface + * with a regular Wayland surface. Using the IviSurface interface, the client can identify + * itself by giving an ivi id, and the compositor can ask the client to resize. + * + * IviApplication corresponds to the Wayland \c ivi_application interface. + * + * To provide the functionality of the shell extension in a compositor, create + * an instance of the IviApplication component and add it to the list of extensions + * supported by the compositor: + * \code + * import QtWayland.Compositor 1.0 + * + * WaylandCompositor { + * IviApplication { + * onIviSurfaceCreated: { + * if (iviSurface.iviId === navigationIviId) { + * // ... + * } + * } + * } + * } + * \endcode + */ + +/*! + * \class QWaylandIviApplication + * \inmodule QtWaylandCompositor + * \since 5.8 + * \brief The QWaylandIviApplication class is an extension for embedded-style user interfaces. + * + * The QWaylandIviApplication extension provides a way to associate an QWaylandIviSurface + * with a regular Wayland surface. Using the QWaylandIviSurface interface, the client can identify + * itself by giving an ivi id, and the compositor can ask the client to resize. + * + * QWaylandIviApplication corresponds to the Wayland \c ivi_application interface. + */ + /*! * Constructs a QWaylandIviApplication object. */ -- cgit v1.2.3 From 00a99e631459eb7e52fde822c24d7b9d603008c4 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 26 Sep 2017 12:20:51 +0200 Subject: Add missing QML documentation for IviSurface Change-Id: I4b84d7eac0016dccaa370419487940e32130617e Reviewed-by: Venugopal Shivashankar --- src/compositor/extensions/qwaylandivisurface.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index dde7ce619..0bb2a6158 100644 --- a/src/compositor/extensions/qwaylandivisurface.cpp +++ b/src/compositor/extensions/qwaylandivisurface.cpp @@ -50,6 +50,18 @@ QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandIviSurfacePrivate::s_role("ivi_surface"); +/*! + * \qmltype IviSurface + * \inqmlmodule QtWayland.Compositor + * \since 5.8 + * \brief Provides a simple way to identify and resize a surface. + * + * This type is part of the \l{IviApplication} extension and provides a way to extend + * the functionality of an existing WaylandSurface with a way to resize and identify it. + * + * It corresponds to the Wayland \c ivi_surface interface. + */ + /*! * \class QWaylandIviSurface * \inmodule QtWaylandCompositor @@ -57,10 +69,9 @@ QWaylandSurfaceRole QWaylandIviSurfacePrivate::s_role("ivi_surface"); * \brief The QWaylandIviSurface class provides a simple way to identify and resize a surface. * * This class is part of the QWaylandIviApplication extension and provides a way to - * extend the functionality of an existing QWaylandSurface with features a way to - * resize and identify it. + * extend the functionality of an existing QWaylandSurface with a way to resize and identify it. * - * It corresponds to the Wayland interface ivi_surface. + * It corresponds to the Wayland \c ivi_surface interface. */ /*! -- cgit v1.2.3