[wayland] Keep Registry for internal connection around

Allows to interact with the Registry for the internal connection in
other parts of KWin and makes it possible to create more than just the
ShmPool for this Registry.
icc-effect-5.14.5
Martin Gräßlin 2015-08-14 09:28:46 +02:00
parent 7b1000385c
commit 6294961ba4
2 changed files with 8 additions and 2 deletions

View File

@ -274,9 +274,10 @@ void WaylandServer::createInternalConnection()
[this] {
Registry *registry = new Registry(m_internalConnection.client);
registry->create(m_internalConnection.client);
m_internalConnection.registry = registry;
connect(registry, &Registry::shmAnnounced, this,
[this, registry] (quint32 name, quint32 version) {
m_internalConnection.shm = registry->createShmPool(name, version, m_internalConnection.client);
[this] (quint32 name, quint32 version) {
m_internalConnection.shm = m_internalConnection.registry->createShmPool(name, version, m_internalConnection.client);
}
);
registry->setup();

View File

@ -31,6 +31,7 @@ namespace KWayland
namespace Client
{
class ConnectionThread;
class Registry;
class ShmPool;
class Surface;
}
@ -131,6 +132,9 @@ public:
KWayland::Client::ConnectionThread *internalClientConection() {
return m_internalConnection.client;
}
KWayland::Client::Registry *internalClientRegistry() {
return m_internalConnection.registry;
}
void dispatch();
quint32 createWindowId(KWayland::Server::SurfaceInterface *surface);
@ -155,6 +159,7 @@ private:
struct {
KWayland::Server::ClientConnection *server = nullptr;
KWayland::Client::ConnectionThread *client = nullptr;
KWayland::Client::Registry *registry = nullptr;
KWayland::Client::ShmPool *shm = nullptr;
} m_internalConnection;