diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-12 19:39:48 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-12 19:39:48 +0200 |
commit | 6f9e0e3876a60562fdc20496767ebf17cbb89f02 (patch) | |
tree | 939943819f0ea51a9f33fe2f033114f620e2de1f /Widgets/Widget.cpp | |
parent | 74aa4d53453843280413cb3a12b274c322c0cbf7 (diff) | |
download | serenity-6f9e0e3876a60562fdc20496767ebf17cbb89f02.zip |
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.
Diffstat (limited to 'Widgets/Widget.cpp')
-rw-r--r-- | Widgets/Widget.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Widgets/Widget.cpp b/Widgets/Widget.cpp index f5a66e79f1..a742ba6461 100644 --- a/Widgets/Widget.cpp +++ b/Widgets/Widget.cpp @@ -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) |