mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibGUI: Make GWindow drive relayout and do it recursively
Instead of only doing a relayout in the widget you're invalidating, we now do a recursive top-down relayout so everything gets updated. This fixes invalid results after updating a preferred size in some situations with nested layouts.
This commit is contained in:
@@ -736,3 +736,16 @@ void GWindow::set_fullscreen(bool fullscreen)
|
||||
request.value = fullscreen;
|
||||
GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidSetFullscreen);
|
||||
}
|
||||
|
||||
void GWindow::schedule_relayout()
|
||||
{
|
||||
if (m_layout_pending)
|
||||
return;
|
||||
m_layout_pending = true;
|
||||
deferred_invoke([this](auto&) {
|
||||
if (main_widget())
|
||||
main_widget()->do_layout();
|
||||
update();
|
||||
m_layout_pending = false;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user