1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

Ignore WindowManager invalidations inside already invalidated rects.

This commit is contained in:
Andreas Kling 2019-01-12 03:07:23 +01:00
parent d6bbd2126d
commit 83252397e4
2 changed files with 15 additions and 2 deletions

View file

@ -63,6 +63,14 @@ public:
return contains(point.x(), point.y()); return contains(point.x(), point.y());
} }
bool contains(const Rect& other) const
{
return left() <= other.left()
&& right() >= other.right()
&& top() <= other.top()
&& bottom() >= other.bottom();
}
int left() const { return x(); } int left() const { return x(); }
int right() const { return x() + width() - 1; } int right() const { return x() + width() - 1; }
int top() const { return y(); } int top() const { return y(); }

View file

@ -339,7 +339,12 @@ void WindowManager::invalidate()
void WindowManager::invalidate(const Rect& rect) void WindowManager::invalidate(const Rect& rect)
{ {
if (!rect.is_empty()) if (rect.is_empty())
return;
for (auto& r : m_invalidated_rects) {
if (r.contains(rect))
return;
}
m_invalidated_rects.append(rect); m_invalidated_rects.append(rect);
} }