1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 22:25:07 +00:00

LibGUI: Don't assume main widget exists in Window::handle_resize_event()

Just like the other event handler functions, handle_resize_event()
shouldn't assume that the window has a main widget (which is being
resized in this case).

Fixes #4450.
This commit is contained in:
Linus Groh 2020-12-18 13:47:04 +00:00 committed by Andreas Kling
parent 573d5b7ff2
commit fe88f46bc9

View file

@ -377,6 +377,7 @@ void Window::handle_resize_event(ResizeEvent& event)
m_pending_paint_event_rects.append({ {}, new_size }); m_pending_paint_event_rects.append({ {}, new_size });
} }
m_rect_when_windowless = { {}, new_size }; m_rect_when_windowless = { {}, new_size };
if (m_main_widget)
m_main_widget->set_relative_rect({ {}, new_size }); m_main_widget->set_relative_rect({ {}, new_size });
} }