//client implementation Client::Client(Compositor& comp, wl_client& wlc) : wlClient_(&wlc), compositor_(&comp) { ny::sendLog("creating client ", this, " for wl_client ", &wlc); listener_ = std::make_unique<listenerPOD>(); listener_->listener.notify = clientDestroyListener; listener_->client = this; wl_client_add_destroy_listener(wlClient_, &listener_->listener); }
QWaylandClient::QWaylandClient(wl_client *client) : QObject(*new QWaylandClientPrivate(client)) { Q_D(QWaylandClient); // Destroy wrapper when the client goes away d->listener.parent = this; d->listener.listener.notify = QWaylandClientPrivate::client_destroy_callback; wl_client_add_destroy_listener(client, &d->listener.listener); }
ClientConnection::Private::Private(wl_client *c, Display *display, ClientConnection *q) : client(c) , display(display) , q(q) { s_allClients << this; listener.notify = destroyListenerCallback; wl_client_add_destroy_listener(c, &listener); wl_client_get_credentials(client, &pid, &user, &group); executablePath = QFileInfo(QStringLiteral("/proc/%1/exe").arg(pid)).symLinkTarget(); }
/*! * Constructs a QWaylandClient for the \a compositor and the Wayland \a client. */ QWaylandClient::QWaylandClient(QWaylandCompositor *compositor, wl_client *client) : QObject(*new QWaylandClientPrivate(compositor, client)) { Q_D(QWaylandClient); // Destroy wrapper when the client goes away d->listener.parent = this; d->listener.listener.notify = QWaylandClientPrivate::client_destroy_callback; wl_client_add_destroy_listener(client, &d->listener.listener); QWaylandCompositorPrivate::get(compositor)->addClient(this); }