summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@kdab.com>2016-02-03 10:42:27 +0200
committerGiulio Camuffo <giuliocamuffo@gmail.com>2016-02-12 15:00:16 +0000
commit74b1ec474d1d48242893dcaf58b8a35f155f3fc3 (patch)
treea439d3307b7511eab756d1e90a44a70c5d2715a2 /src
parent03a8036674d07daadd2ee716f92e840a18ed2753 (diff)
downloadqtwayland-74b1ec474d1d48242893dcaf58b8a35f155f3fc3.tar.gz
Expose a method to send ping events in QWaylandShellSurface
It must be callable by the user so it must be public API. Change-Id: Ic028843189148130a57a21e6e64840bd400dc7dc Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/compositor/extensions/qwaylandshell.cpp24
-rw-r--r--src/compositor/extensions/qwaylandshell.h4
-rw-r--r--src/compositor/extensions/qwaylandshell_p.h1
3 files changed, 22 insertions, 7 deletions
diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp
index 8bd3e6ad..9865432e 100644
--- a/src/compositor/extensions/qwaylandshell.cpp
+++ b/src/compositor/extensions/qwaylandshell.cpp
@@ -88,12 +88,6 @@ QWaylandShellSurfacePrivate::~QWaylandShellSurfacePrivate()
{
}
-void QWaylandShellSurfacePrivate::ping()
-{
- uint32_t serial = m_surface->compositor()->nextSerial();
- ping(serial);
-}
-
void QWaylandShellSurfacePrivate::ping(uint32_t serial)
{
m_pings.insert(serial);
@@ -566,4 +560,22 @@ QWaylandSurfaceRole *QWaylandShellSurface::role()
return &QWaylandShellSurfacePrivate::s_role;
}
+/*!
+ * \qmlmethod void QtWaylandCompositor::ShellSurface::ping()
+ *
+ * Sends a ping event to the client. If the client replies to the event the \a pong
+ * signal will be emitted.
+ */
+
+/*!
+ * Sends a ping event to the client. If the client replies to the event the \a pong
+ * signal will be emitted.
+ */
+void QWaylandShellSurface::ping()
+{
+ Q_D(QWaylandShellSurface);
+ uint32_t serial = d->m_surface->compositor()->nextSerial();
+ d->ping(serial);
+}
+
QT_END_NAMESPACE
diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandshell.h
index 225aeeb4..403d7ca9 100644
--- a/src/compositor/extensions/qwaylandshell.h
+++ b/src/compositor/extensions/qwaylandshell.h
@@ -125,6 +125,10 @@ public:
Q_INVOKABLE QSize sizeForResize(const QSizeF &size, const QPointF &delta, ResizeEdge edges);
Q_INVOKABLE void sendConfigure(const QSize &size, ResizeEdge edges);
Q_INVOKABLE void sendPopupDone();
+
+public Q_SLOTS:
+ void ping();
+
Q_SIGNALS:
void surfaceChanged();
void titleChanged();
diff --git a/src/compositor/extensions/qwaylandshell_p.h b/src/compositor/extensions/qwaylandshell_p.h
index 9243eb97..24f2138e 100644
--- a/src/compositor/extensions/qwaylandshell_p.h
+++ b/src/compositor/extensions/qwaylandshell_p.h
@@ -87,7 +87,6 @@ public:
static QWaylandShellSurfacePrivate *get(QWaylandShellSurface *surface) { return surface->d_func(); }
- void ping();
void ping(uint32_t serial);
void setFocusPolicy(QWaylandShellSurface::FocusPolicy focusPolicy)