Commit 183479fe authored by Martin Flöser's avatar Martin Flöser

[wayland] Only create PlasmaWindowInterface if AbstractClient has a surface

With Xwayland clients it can happen that the window gets destroyed
before it ever got a surface (Qt 5's file open dialog being an example).

This change delays such clients till it got the surface, removing not
needed roundtrips and possible problems.
parent 34426646
......@@ -87,6 +87,9 @@ void WaylandServer::init(const QByteArray &socketName)
};
if (Toplevel *t = ws->findToplevel(check)) {
t->setSurface(surface);
if (Client *c = dynamic_cast<Client*>(t)) {
announceClientToWindowManagement(c);
}
}
}
);
......@@ -205,6 +208,9 @@ void WaylandServer::initWorkspace()
void WaylandServer::announceClientToWindowManagement(AbstractClient *c)
{
if (!c->surface()) {
return;
}
auto w = m_windowManagement->createWindow(c);
w->setTitle(c->caption());
w->setVirtualDesktop(c->isOnAllDesktops() ? 0 : c->desktop() - 1);
......
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