summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-04 10:42:45 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-04 10:42:45 +0200
commit04f6ff77ef0c8858629766e191ecc3d4ef056848 (patch)
treed3684e21bf277bdd2b0d284042d627d97ad528db
parenta81fc596a3cbcc07396be1c0284f1ee8aa44ff8c (diff)
parent00a99e631459eb7e52fde822c24d7b9d603008c4 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta1
-rw-r--r--examples/wayland/minimal-cpp/window.cpp7
-rw-r--r--src/compositor/compositor_api/qwaylandseat.cpp11
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.cpp4
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.h3
-rw-r--r--src/compositor/compositor_api/qwaylandview.cpp9
-rw-r--r--src/compositor/extensions/qwaylandiviapplication.cpp43
-rw-r--r--src/compositor/extensions/qwaylandivisurface.cpp17
-rw-r--r--src/compositor/extensions/qwaylandquickshellsurfaceitem.cpp14
-rw-r--r--src/compositor/extensions/qwaylandshell.cpp8
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.cpp54
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5.h2
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5_p.h2
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration_p.h2
13 files changed, 123 insertions, 53 deletions
diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp
index f0d0fd5d..a23bba3a 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 60a9c60d..80b75d61 100644
--- a/src/compositor/compositor_api/qwaylandseat.cpp
+++ b/src/compositor/compositor_api/qwaylandseat.cpp
@@ -154,6 +154,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
* \since 5.8
diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp
index 6a6d6520..6f277dd9 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 a2186491..010f279a 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 1ce923d4..f56cb0b8 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 d1e87dcc..d0466244 100644
--- a/src/compositor/extensions/qwaylandiviapplication.cpp
+++ b/src/compositor/extensions/qwaylandiviapplication.cpp
@@ -48,6 +48,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.
*/
QWaylandIviApplication::QWaylandIviApplication()
diff --git a/src/compositor/extensions/qwaylandivisurface.cpp b/src/compositor/extensions/qwaylandivisurface.cpp
index dde7ce61..0bb2a615 100644
--- a/src/compositor/extensions/qwaylandivisurface.cpp
+++ b/src/compositor/extensions/qwaylandivisurface.cpp
@@ -51,16 +51,27 @@ 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
* \since 5.8
* \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 b43ee957..e52bb485 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 836407d3..adb5827d 100644
--- a/src/compositor/extensions/qwaylandshell.cpp
+++ b/src/compositor/extensions/qwaylandshell.cpp
@@ -58,12 +58,6 @@ QWaylandShell::QWaylandShell(QWaylandObject *waylandObject)
}
/*!
- * \qmlproperty enum QtWaylandCompositor::Shell::focusPolicy
- *
- * This property holds the focus policy of the Shell.
- */
-
-/*!
* \enum QWaylandShell::FocusPolicy
*
* This enum type is used to specify the focus policy for shell surfaces.
@@ -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 dfb65a2f..8f116426 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 7639daf3..05b49f6e 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 852520fd..9b14f525 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 26d9f613..7ca04c02 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