Commit c17e574f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

x11: Fix damage region updates

We cannot use addDamage() in getDamageReply() because the former sets
back the m_isDamaged flag.


(cherry picked from commit e117caa3)
parent 256245cd
......@@ -403,7 +403,7 @@ void Toplevel::getDamageRegionReply()
reply->extents.width, reply->extents.height);
free(reply);
addDamage(region);
addDamage_helper(region);
}
void Toplevel::addDamageFull()
......@@ -412,17 +412,7 @@ void Toplevel::addDamageFull()
return;
const QRect bufferRect = bufferGeometry();
const QRect frameRect = frameGeometry();
const int offsetX = bufferRect.x() - frameRect.x();
const int offsetY = bufferRect.y() - frameRect.y();
const QRect damagedRect(0, 0, bufferRect.width(), bufferRect.height());
damage_region = damagedRect;
addRepaint(damagedRect.translated(offsetX, offsetY));
emit damaged(this, damage_region);
addDamage_helper(QRect(0, 0, bufferRect.width(), bufferRect.height()));
}
void Toplevel::resetDamage()
......@@ -738,11 +728,16 @@ void Toplevel::setSurface(KWaylandServer::SurfaceInterface *surface)
}
void Toplevel::addDamage(const QRegion &damage)
{
m_isDamaged = true;
addDamage_helper(damage);
}
void Toplevel::addDamage_helper(const QRegion &damage)
{
const QRect bufferRect = bufferGeometry();
const QRect frameRect = frameGeometry();
m_isDamaged = true;
damage_region += damage;
addRepaint(damage.translated(bufferRect.topLeft() - frameRect.topLeft()));
......
......@@ -695,6 +695,7 @@ protected:
void discardWindowPixmap();
void addDamageFull();
virtual void addDamage(const QRegion &damage);
void addDamage_helper(const QRegion &damage);
Xcb::Property fetchWmClientLeader() const;
void readWmClientLeader(Xcb::Property &p);
void getWmClientLeader();
......
Supports Markdown
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