From 74b1ec474d1d48242893dcaf58b8a35f155f3fc3 Mon Sep 17 00:00:00 2001 From: Giulio Camuffo Date: Wed, 3 Feb 2016 10:42:27 +0200 Subject: 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 --- src/compositor/extensions/qwaylandshell.cpp | 24 ++++++++++++++++++------ src/compositor/extensions/qwaylandshell.h | 4 ++++ src/compositor/extensions/qwaylandshell_p.h | 1 - 3 files changed, 22 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/compositor/extensions/qwaylandshell.cpp b/src/compositor/extensions/qwaylandshell.cpp index 8bd3e6adb..9865432ed 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 225aeeb4e..403d7ca93 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 9243eb97e..24f2138e0 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) -- cgit v1.2.3