13#include <wayland-server.h>
33 static void destroyListenerCallback(wl_listener *listener,
void *data);
34 static void destroyLateListenerCallback(wl_listener *listener,
void *data);
36 wl_listener destroyListener;
37 wl_listener destroyLateListener;
38 static QList<ClientConnectionPrivate *> s_allClients;
41QList<ClientConnectionPrivate *> ClientConnectionPrivate::s_allClients;
50 destroyListener.notify = destroyListenerCallback;
51 wl_client_add_destroy_listener(c, &destroyListener);
53 destroyLateListener.notify = destroyLateListenerCallback;
54 wl_client_add_destroy_late_listener(c, &destroyLateListener);
62 s_allClients.removeAt(s_allClients.indexOf(
this));
65void ClientConnectionPrivate::destroyListenerCallback(wl_listener *listener,
void *data)
67 wl_client *
client =
reinterpret_cast<wl_client *
>(data);
69 return c->client == client;
71 Q_ASSERT(it != s_allClients.constEnd());
76 wl_list_remove(&p->destroyListener.link);
80void ClientConnectionPrivate::destroyLateListenerCallback(wl_listener *listener,
void *data)
82 wl_client *
client =
reinterpret_cast<wl_client *
>(data);
84 return c->client == client;
86 Q_ASSERT(it != s_allClients.constEnd());
90 wl_list_remove(&p->destroyLateListener.link);
94ClientConnection::ClientConnection(wl_client *c,
Display *parent)
96 , d(new ClientConnectionPrivate(c, parent, this))
104 wl_client_flush(d->client);
109 wl_client_destroy(d->client);
114 return wl_client_get_object(d->client,
id);
122ClientConnection::operator wl_client *()
127ClientConnection::operator wl_client *()
const
154 return d->executablePath;
159 Q_ASSERT(scaleOveride != 0);
160 d->scaleOverride = scaleOveride;
166 return d->scaleOverride;
171 d->securityContextAppId = appId;
176 return d->securityContextAppId;
180#include "moc_clientconnection.cpp"
Convenient Class which represents a wl_client.
void setScaleOverride(qreal scaleOverride)
QString executablePath() const
virtual ~ClientConnection()
QString securityContextAppId() const
wl_resource * getResource(quint32 id) const
Display * display() const
void aboutToBeDestroyed()
wl_client * client() const
void setSecurityContextAppId(const QString &appId)
void disconnected(KWin::ClientConnection *)
void scaleOverrideChanged()
qreal scaleOverride() const
QString securityContextAppId
~ClientConnectionPrivate()
ClientConnectionPrivate(wl_client *c, Display *display, ClientConnection *q)
Class holding the Wayland server display loop.
QString executablePathFromPid(pid_t)