[wayland] Process pending state and map the client on commit

Summary:
Move unrelated code out of XdgShellClient::addDamage() into a separate
method.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24328
icc-effect-master
Vlad Zahorodnii 2019-09-26 18:02:09 +03:00
parent 493bbdc24a
commit 84de8d135d
2 changed files with 18 additions and 16 deletions

View File

@ -100,7 +100,6 @@ void XdgShellClient::init()
m_windowType = NET::OnScreenDisplay;
}
connect(surface(), &SurfaceInterface::sizeChanged, this, &XdgShellClient::handleSurfaceSizeChanged);
connect(surface(), &SurfaceInterface::unmapped, this, &XdgShellClient::unmap);
connect(surface(), &SurfaceInterface::unbound, this, &XdgShellClient::destroyClient);
connect(surface(), &SurfaceInterface::destroyed, this, &XdgShellClient::destroyClient);
@ -180,6 +179,8 @@ void XdgShellClient::finishInit()
{
disconnect(surface(), &SurfaceInterface::committed, this, &XdgShellClient::finishInit);
connect(surface(), &SurfaceInterface::committed, this, &XdgShellClient::handleCommitted);
bool needsPlacement = !isInitialPositionSet();
if (supportsWindowRules()) {
@ -383,14 +384,6 @@ void XdgShellClient::setOpacity(double opacity)
void XdgShellClient::addDamage(const QRegion &damage)
{
auto s = surface();
if (s->size().isValid()) {
m_clientSize = s->size();
updateWindowMargins();
updatePendingGeometry();
}
markAsMapped();
setDepth((s->buffer()->hasAlphaChannel() && !isDesktop()) ? 32 : 24);
repaints_region += damage.translated(clientPos());
Toplevel::addDamage(damage);
}
@ -1082,12 +1075,6 @@ void XdgShellClient::handleConfigureAcknowledged(quint32 serial)
m_lastAckedConfigureRequest = serial;
}
void XdgShellClient::handleSurfaceSizeChanged()
{
m_clientSize = surface()->size();
doSetGeometry(QRect(pos(), m_clientSize + QSize(borderLeft() + borderRight(), borderTop() + borderBottom())));
}
void XdgShellClient::handleTransientForChanged()
{
SurfaceInterface *transientSurface = nullptr;
@ -1255,6 +1242,21 @@ void XdgShellClient::handlePongReceived(quint32 serial)
}
}
void XdgShellClient::handleCommitted()
{
if (!surface()->buffer()) {
return;
}
m_clientSize = surface()->size();
updateWindowMargins();
updatePendingGeometry();
setDepth((surface()->buffer()->hasAlphaChannel() && !isDesktop()) ? 32 : 24);
markAsMapped();
}
void XdgShellClient::resizeWithChecks(int w, int h, ForceGeometry_t force)
{
Q_UNUSED(force)

View File

@ -142,7 +142,6 @@ protected:
private Q_SLOTS:
void handleConfigureAcknowledged(quint32 serial);
void handleSurfaceSizeChanged();
void handleTransientForChanged();
void handleWindowClassChanged(const QByteArray &windowClass);
void handleWindowTitleChanged(const QString &title);
@ -156,6 +155,7 @@ private Q_SLOTS:
void handlePingDelayed(quint32 serial);
void handlePingTimeout(quint32 serial);
void handlePongReceived(quint32 serial);
void handleCommitted();
private:
/**