diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp index f0d0fd5d9987875829715beb25e91f1a1a195295..a23bba3ae59958e778b40f14574660ce42637a87 100644 --- a/examples/wayland/minimal-cpp/window.cpp +++ b/examples/wayland/minimal-cpp/window.cpp @@ -86,7 +86,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); @@ -96,6 +97,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()) { diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 60a9c60d2a96e2445b3d470067f7575915831375..80b75d61737072bf366ad7280e5334dbe9859b3a 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 diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 6a6d652066b5901bcd697bead2cbd267c9272d08..6f277dd96aeadcde966d485b6206ea5a185f8161 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 a2186491b3d31056977a4e617539d698d89bf8c5..010f279af52db5e18e66237da0c4b903900fa882 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(); diff --git a/src/compositor/compositor_api/qwaylandview.cpp b/src/compositor/compositor_api/qwaylandview.cpp index 1ce923d48c2c743f7f8d67a18bfc0a38448386ec..f56cb0b8e0d6e3e956eb902ca33869d0b15b1267 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 * diff --git a/src/compositor/extensions/qwaylandiviapplication.cpp b/src/compositor/extensions/qwaylandiviapplication.cpp index d1e87dcc4c7252b616738dd93176e2afd0ada043..d04662447a6d4881e5bf55fe1fc4015a408c8a37 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. */ diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp index dde7ce61938e68ca4c76a5583e2c3eb5561f1c8d..0bb2a6158380e9335fdc80bfa9a4d033b8c080b5 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. */ /*! diff --git a/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp b/src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp index b43ee957aa75946234782fa0114c8816ad1fb9dd..e52bb4852f7c65d7d1bdaf8853a190a2cce9e538 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 */ /*! diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp index 836407d361f68cb75eeeaf4044946eff676cc0b2..adb5827d4f1ac728d05c6f60f2ab01633ed0786f 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. */ diff --git a/src/compositor/extensions/qwaylandxdgshellv5.cpp b/src/compositor/extensions/qwaylandxdgshellv5.cpp index dfb65a2f35b24db351c9cb95276e599fbb90102f..8f11642603a57bb0c1a8acd544c4cf0a11d0adc9 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. @@ -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<uint> states) + * \qmlmethod int QtWaylandCompositor::XdgSurfaceV5::sendConfigure(size size, list<uint> 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<QWayla } /*! - * \qmlmethod void QtWaylandCompositor::XdgSurface::sendClose() + * \qmlmethod void QtWaylandCompositor::XdgSurfaceV5::sendClose() * * Sends a close event to the client. */ @@ -1147,7 +1147,7 @@ QWaylandXdgPopupV5::QWaylandXdgPopupV5(QWaylandXdgShellV5 *xdgShell, QWaylandSur } /*! - * \qmlmethod void QtWaylandCompositor::XdgPopup::initialize(object surface, object parentSurface, object resource) + * \qmlmethod void QtWaylandCompositor::XdgPopupV5::initialize(object surface, object parentSurface, object resource) * * Initializes the xdg popup, associating it with the given \a shell, \a surface, * \a parentSurface and \a resource. @@ -1175,9 +1175,9 @@ void QWaylandXdgPopupV5::initialize(QWaylandXdgShellV5 *shell, QWaylandSurface * } /*! - * \qmlproperty object QtWaylandCompositor::XdgPopup::shell + * \qmlproperty object QtWaylandCompositor::XdgPopupV5::shell * - * This property holds the shell associated with this XdgPopup. + * This property holds the shell associated with this XdgPopupV5. */ /*! @@ -1192,9 +1192,9 @@ QWaylandXdgShellV5 *QWaylandXdgPopupV5::shell() const } /*! - * \qmlproperty object QtWaylandCompositor::XdgPopup::surface + * \qmlproperty object QtWaylandCompositor::XdgPopupV5::surface * - * This property holds the surface associated with this XdgPopup. + * This property holds the surface associated with this XdgPopupV5. */ /*! @@ -1209,9 +1209,9 @@ QWaylandSurface *QWaylandXdgPopupV5::surface() const } /*! - * \qmlproperty object QtWaylandCompositor::XdgPopup::parentSurface + * \qmlproperty object QtWaylandCompositor::XdgPopupV5::parentSurface * - * This property holds the surface associated with the parent of this XdgPopup. + * This property holds the surface associated with the parent of this XdgPopupV5. */ /*! @@ -1228,7 +1228,7 @@ QWaylandSurface *QWaylandXdgPopupV5::parentSurface() const /*! - * \qmlproperty object QtWaylandCompositor::XdgPopup::position + * \qmlproperty object QtWaylandCompositor::XdgPopupV5::position * * This property holds the location of the upper left corner of the surface * relative to the upper left corner of the parent surface, in surface local diff --git a/src/compositor/extensions/qwaylandxdgshellv5.h b/src/compositor/extensions/qwaylandxdgshellv5.h index 7639daf3928f2673c4628396d51aed47ae3ce76f..05b49f6ef588a09450c7d708c163550071d4ef68 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5.h +++ b/src/compositor/extensions/qwaylandxdgshellv5.h @@ -256,4 +256,4 @@ private: QT_END_NAMESPACE -#endif /*QWAYLANDXDGSHELL_H*/ +#endif /*QWAYLANDXDGSHELLV5_H*/ diff --git a/src/compositor/extensions/qwaylandxdgshellv5_p.h b/src/compositor/extensions/qwaylandxdgshellv5_p.h index 852520fdfd87ad3ed0b19492dae91c6da09b0ba7..9b14f525d1c7e15ed8776ebd2fe301d1b1bad128 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv5_p.h @@ -179,4 +179,4 @@ public: QT_END_NAMESPACE -#endif // QWAYLANDXDGSHELL_P_H +#endif // QWAYLANDXDGSHELLV5_P_H diff --git a/src/compositor/extensions/qwaylandxdgshellv5integration_p.h b/src/compositor/extensions/qwaylandxdgshellv5integration_p.h index 26d9f613e99e7e9d3cc028673a31961d5ca3b377..7ca04c0295a04944d6ab90283d3a05d0e6cbd7bc 100644 --- a/src/compositor/extensions/qwaylandxdgshellv5integration_p.h +++ b/src/compositor/extensions/qwaylandxdgshellv5integration_p.h @@ -130,4 +130,4 @@ private: QT_END_NAMESPACE -#endif // QWAYLANDXDGSHELLINTEGRATION_H +#endif // QWAYLANDXDGSHELLV5INTEGRATION_H