diff --git a/xdgshellclient.h b/xdgshellclient.h --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -188,6 +188,7 @@ void unmap(); void markAsMapped(); QRect determineBufferGeometry() const; + void ping(PingReason reason); static void deleteClient(XdgShellClient *c); QRect adjustMoveGeometry(const QRect &rect) const; @@ -260,7 +261,7 @@ QRect m_blockedRequestGeometry; QString m_caption; QString m_captionSuffix; - QHash m_pingSerials; + QHash m_pingSerials; bool m_isInitialized = false; diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -652,8 +652,7 @@ { if (m_xdgShellSurface && isCloseable()) { m_xdgShellSurface->close(); - const qint32 pingSerial = static_cast(m_xdgShellSurface->global())->ping(m_xdgShellSurface); - m_pingSerials.insert(pingSerial, PingReason::CloseWindow); + ping(PingReason::CloseWindow); } } @@ -989,8 +988,7 @@ { if (rules()->checkAcceptFocus(wantsInput())) { if (m_xdgShellSurface) { - const qint32 pingSerial = static_cast(m_xdgShellSurface->global())->ping(m_xdgShellSurface); - m_pingSerials.insert(pingSerial, PingReason::FocusWindow); + ping(PingReason::FocusWindow); } setActive(true); } @@ -2043,4 +2041,13 @@ return geometry; } +void XdgShellClient::ping(PingReason reason) +{ + Q_ASSERT(m_xdgShellSurface); + + XdgShellInterface *shell = static_cast(m_xdgShellSurface->global()); + const quint32 serial = shell->ping(m_xdgShellSurface); + m_pingSerials.insert(serial, reason); +} + }