Commit 6294961b authored by Martin Flöser's avatar Martin Flöser

[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.
parent 7b100038
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment