1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

After moving a window, try to repaint a bit less.

Only repaint windows that intersect either the old or the new rect.
Also only repaint those rects in the root widget.
This commit is contained in:
Andreas Kling 2018-10-12 19:39:48 +02:00
parent 74aa4d5345
commit 6f9e0e3876
9 changed files with 111 additions and 23 deletions

View file

@ -23,6 +23,11 @@ void Widget::setWindowRelativeRect(const Rect& rect)
update();
}
void Widget::repaint(const Rect& rect)
{
event(*make<PaintEvent>(rect));
}
void Widget::event(Event& event)
{
switch (event.type()) {
@ -94,7 +99,7 @@ void Widget::update()
if (m_hasPendingPaintEvent)
return;
m_hasPendingPaintEvent = true;
EventLoop::main().postEvent(this, make<PaintEvent>());
EventLoop::main().postEvent(this, make<PaintEvent>(rect()));
}
Widget::HitTestResult Widget::hitTest(int x, int y)