summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2016-08-14 10:56:05 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>2016-08-15 11:30:32 +0000
commit768a28b284fa806cba38f864c56ba2e2c37296f2 (patch)
tree3f71557a400abd1733238cf600c0ec4dc8bde814
parentb9f0673a7928c896f44caf282c61b1080651f6b8 (diff)
compositor: Add shell property to xdg-shell
Add a shell property to QWaylandXdgSurface and QWaylandXdgPopup like QWaylandWlShellSurface. Change-Id: Id321f2ba8a48284c31fe67c4600c86f5c134b68d Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/compositor/extensions/qwaylandxdgshell.cpp36
-rw-r--r--src/compositor/extensions/qwaylandxdgshell.h8
2 files changed, 44 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshell.cpp b/src/compositor/extensions/qwaylandxdgshell.cpp
index 93944fb32..273803d68 100644
--- a/src/compositor/extensions/qwaylandxdgshell.cpp
+++ b/src/compositor/extensions/qwaylandxdgshell.cpp
@@ -677,6 +677,7 @@ void QWaylandXdgSurface::initialize(QWaylandXdgShell *xdgShell, QWaylandSurface
d->m_windowGeometry = d->calculateFallbackWindowGeometry();
connect(surface, &QWaylandSurface::sizeChanged, this, &QWaylandXdgSurface::handleSurfaceSizeChanged);
connect(surface, &QWaylandSurface::bufferScaleChanged, this, &QWaylandXdgSurface::handleBufferScaleChanged);
+ emit shellChanged();
emit surfaceChanged();
emit windowGeometryChanged();
QWaylandCompositorExtension::initialize();
@@ -712,6 +713,23 @@ void QWaylandXdgSurface::handleBufferScaleChanged()
}
/*!
+ * \qmlproperty object QtWaylandCompositor::XdgSurface::shell
+ *
+ * This property holds the shell associated with this XdgSurface.
+ */
+
+/*!
+ * \property QWaylandXdgSurface::shell
+ *
+ * This property holds the shell associated with this QWaylandXdgSurface.
+ */
+QWaylandXdgShell *QWaylandXdgSurface::shell() const
+{
+ Q_D(const QWaylandXdgSurface);
+ return d->m_xdgShell;
+}
+
+/*!
* \qmlproperty object QtWaylandCompositor::XdgSurface::surface
*
* This property holds the surface associated with this XdgSurface.
@@ -1039,12 +1057,30 @@ void QWaylandXdgPopup::initialize(QWaylandXdgShell *shell, QWaylandSurface *surf
d->m_position = position;
d->init(resource.resource());
setExtensionContainer(surface);
+ emit shellChanged();
emit surfaceChanged();
emit parentSurfaceChanged();
QWaylandCompositorExtension::initialize();
}
/*!
+ * \qmlproperty object QtWaylandCompositor::XdgPopup::shell
+ *
+ * This property holds the shell associated with this XdgPopup.
+ */
+
+/*!
+ * \property QWaylandXdgPopup::shell
+ *
+ * This property holds the shell associated with this QWaylandXdgPopup.
+ */
+QWaylandXdgShell *QWaylandXdgPopup::shell() const
+{
+ Q_D(const QWaylandXdgPopup);
+ return d->m_xdgShell;
+}
+
+/*!
* \qmlproperty object QtWaylandCompositor::XdgPopup::surface
*
* This property holds the surface associated with this XdgPopup.
diff --git a/src/compositor/extensions/qwaylandxdgshell.h b/src/compositor/extensions/qwaylandxdgshell.h
index 3886f122b..4a1ec5d06 100644
--- a/src/compositor/extensions/qwaylandxdgshell.h
+++ b/src/compositor/extensions/qwaylandxdgshell.h
@@ -93,6 +93,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgSurface : public QWaylandShellSurfa
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandXdgSurface)
+ Q_PROPERTY(QWaylandXdgShell *shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
Q_PROPERTY(QWaylandXdgSurface *parentSurface READ parentSurface NOTIFY parentSurfaceChanged)
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
@@ -141,6 +142,8 @@ public:
bool resizing() const;
bool activated() const;
+ QWaylandXdgShell *shell() const;
+
QWaylandSurface *surface() const;
QWaylandXdgSurface *parentSurface() const;
@@ -164,6 +167,7 @@ public:
#endif
Q_SIGNALS:
+ void shellChanged();
void surfaceChanged();
void titleChanged();
void windowGeometryChanged();
@@ -201,6 +205,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandXdgPopup : public QWaylandShellSurface
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandXdgPopup)
+ Q_PROPERTY(QWaylandXdgShell *shell READ shell NOTIFY shellChanged)
Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
Q_PROPERTY(QWaylandSurface *parentSurface READ parentSurface NOTIFY parentSurfaceChanged)
Q_PROPERTY(QPoint position READ position)
@@ -215,6 +220,8 @@ public:
Q_INVOKABLE void initialize(QWaylandXdgShell *shell, QWaylandSurface *surface,
QWaylandSurface *parentSurface, const QPoint &position, const QWaylandResource &resource);
+ QWaylandXdgShell *shell() const;
+
QWaylandSurface *surface() const;
QWaylandSurface *parentSurface() const;
QPoint position() const;
@@ -231,6 +238,7 @@ public:
#endif
Q_SIGNALS:
+ void shellChanged();
void surfaceChanged();
void parentSurfaceChanged();