[wayland] Ensure size is updated before marking window as ready for painting

Fixes regression introduced with 90a6814: we may not queue a signal
taking a pointer to a ShellClient as the ShellClient might be destroyed
before the queued signal is delivered.

The idea for the queued signal was to ensure that the size is set when
windowShown is emitted - this can also be achieved by first updating the
size.
This commit is contained in:
Martin Gräßlin 2015-05-28 08:27:34 +02:00
parent 90a6814513
commit 988ce28943
2 changed files with 2 additions and 2 deletions

View file

@ -151,11 +151,11 @@ void ShellClient::setOpacity(double opacity)
void ShellClient::addDamage(const QRegion &damage)
{
setReadyForPainting();
if (m_shellSurface->surface()->buffer()->size().isValid()) {
m_clientSize = m_shellSurface->surface()->buffer()->size();
setGeometry(QRect(geom.topLeft(), m_clientSize));
}
setReadyForPainting();
Toplevel::addDamage(damage);
}

View file

@ -127,7 +127,7 @@ void WaylandServer::init(const QByteArray &socketName)
connect(client, &ShellClient::windowShown, this,
[this, client] {
emit shellClientAdded(client);
}, Qt::QueuedConnection
}
);
}
}