Introduce ClientConnection::aboutToBeDestroyed

This signal is useful if the compositor wants to perform some cleanup
before the disconnected signal is emitted or while the connection object
still has valid wl_client native handle.
This commit is contained in:
Vlad Zahorodnii 2021-05-12 22:36:12 +03:00
parent da3f4923f1
commit c2fc33872e
2 changed files with 5 additions and 0 deletions

View file

@ -68,6 +68,7 @@ void ClientConnectionPrivate::destroyListenerCallback(wl_listener *listener, voi
Q_ASSERT(it != s_allClients.constEnd());
auto p = (*it);
auto q = p->q;
emit q->aboutToBeDestroyed();
p->client = nullptr;
wl_list_remove(&p->listener.link);
emit q->disconnected(q);

View file

@ -123,6 +123,10 @@ public:
void destroy();
Q_SIGNALS:
/**
* This signal is emitted when the client is about to be destroyed.
*/
void aboutToBeDestroyed();
/**
* Signal emitted when the ClientConnection got disconnected from the server.
*/