[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.
This commit is contained in:
parent
3442664609
commit
183479fe67
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue