From 57f55f297b6f30755c1441169d3d05cfec37043b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 30 Dec 2019 00:26:19 +0100 Subject: [PATCH] LibGUI: Call GWidget::resize_event() before doing widget layout The widget layout system currently works by having layouts size the children of a widgets. The children then get resize events, giving them a chance to lay out their own children, etc. In keeping with this, we need to handle the resize event before calling do_layout() in a widget, since the resize event handler may do things that end up affecting the layout, but layout should not affect the resize event since the event comes from the widget parent, not itself. --- Libraries/LibGUI/GWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibGUI/GWidget.cpp b/Libraries/LibGUI/GWidget.cpp index d2a88bc966..f184ba54c6 100644 --- a/Libraries/LibGUI/GWidget.cpp +++ b/Libraries/LibGUI/GWidget.cpp @@ -227,8 +227,8 @@ void GWidget::notify_layout_changed(Badge) void GWidget::handle_resize_event(GResizeEvent& event) { + resize_event(event); do_layout(); - return resize_event(event); } void GWidget::handle_mouseup_event(GMouseEvent& event)