From 783afd17b759230ffa388ce7f7aacff500829226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 21 May 2015 11:20:48 +0200 Subject: [PATCH] [wayland] Delay WaylandServer::shellClientAdded till the Surface is ready for painting This simplifies the interaction: we know that the Surface is useable if it got announced to the Workspace. --- wayland_server.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wayland_server.cpp b/wayland_server.cpp index 2d19525195..05a470f5ae 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -121,7 +121,15 @@ void WaylandServer::init(const QByteArray &socketName) } else { m_clients << client; } - emit shellClientAdded(client); + if (client->readyForPainting()) { + emit shellClientAdded(client); + } else { + connect(client, &ShellClient::windowShown, this, + [this, client] { + emit shellClientAdded(client); + } + ); + } } ); m_display->createShm();