mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
LibWeb+WebContent: Change event loop to synchronously paint next frame
...instead of scheduling repaint timer in PageClient. This change fixes flickering on Discord that happened because: - Event loop schedules repainting by activating repaint timer - `Document::tear_down_layout_tree()` destroys paintable tree - Repaint timer invokes callback and renders an empty frame because paintable tree was destroyed
This commit is contained in:
committed by
Andreas Kling
parent
e806136116
commit
b8d18ebcf7
@@ -327,7 +327,10 @@ void EventLoop::process()
|
||||
if (navigable && navigable->needs_repaint()) {
|
||||
auto* browsing_context = document.browsing_context();
|
||||
auto& page = browsing_context->page();
|
||||
page.client().schedule_repaint();
|
||||
if (navigable->is_traversable()) {
|
||||
VERIFY(page.client().is_ready_to_paint());
|
||||
page.client().paint_next_frame();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user