summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-09-06 11:12:10 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-09-07 06:25:12 +0000
commit8b62fafcbe3ec5c1b50d9c3845b5ac961c9c3e87 (patch)
tree2b06d4097067f3fdffcf7a5ea4a4293d9b6985b5
parent3bbb85c3f1374eaf1dc23e94cddaaa90b9908c13 (diff)
Compositor: Add XdgToplevel::xdgSurface
Similar to the property we already have for popups, XdgPopup::xdgSurface. Change-Id: I1a0b77b28a35597139fcf381a4b345ccaa93d626 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/compositor/extensions/qwaylandxdgshell.cpp17
-rw-r--r--src/compositor/extensions/qwaylandxdgshell.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshell.cpp b/src/compositor/extensions/qwaylandxdgshell.cpp
index ce6add3de..4a0db2a53 100644
--- a/src/compositor/extensions/qwaylandxdgshell.cpp
+++ b/src/compositor/extensions/qwaylandxdgshell.cpp
@@ -742,6 +742,23 @@ QWaylandXdgToplevel::~QWaylandXdgToplevel()
}
/*!
+ * \qmlproperty XdgSurface QtWaylandCompositor::XdgToplevel::xdgSurface
+ *
+ * This property holds the XdgSurface for this XdgToplevel.
+ */
+
+/*!
+ * \property QWaylandXdgToplevel::xdgSurface
+ *
+ * This property holds the QWaylandXdgSurface for this QWaylandXdgToplevel.
+ */
+QWaylandXdgSurface *QWaylandXdgToplevel::xdgSurface() const
+{
+ Q_D(const QWaylandXdgToplevel);
+ return d->m_xdgSurface;
+}
+
+/*!
* \qmlproperty XdgToplevel QtWaylandCompositor::XdgToplevel::parentToplevel
*
* This property holds the XdgToplevel parent of this XdgToplevel.
diff --git a/src/compositor/extensions/qwaylandxdgshell.h b/src/compositor/extensions/qwaylandxdgshell.h
index 71454f929..774dd2282 100644
--- a/src/compositor/extensions/qwaylandxdgshell.h
+++ b/src/compositor/extensions/qwaylandxdgshell.h
@@ -142,6 +142,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgToplevel : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandXdgToplevel)
+ Q_PROPERTY(QWaylandXdgSurface *xdgSurface READ xdgSurface CONSTANT)
Q_PROPERTY(QWaylandXdgToplevel *parentToplevel READ parentToplevel NOTIFY parentToplevelChanged)
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QString appId READ appId NOTIFY appIdChanged)
@@ -171,6 +172,7 @@ public:
explicit QWaylandXdgToplevel(QWaylandXdgSurface *xdgSurface, QWaylandResource &resource);
~QWaylandXdgToplevel() override;
+ QWaylandXdgSurface *xdgSurface() const;
QWaylandXdgToplevel *parentToplevel() const;
QString title() const;