1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 01:05:08 +00:00

GWindow: Discard wrongly-sized backing stores in set_rect().

The WindowServer still holds on to at least one backing store in case it
needs to paint us again before we can render a new one. This ensures that
we don't end up stuck with an undersized backing store.
This commit is contained in:
Andreas Kling 2019-04-10 14:35:13 +02:00
parent d4818dd2dd
commit 0ac55f2c38

View file

@ -144,6 +144,10 @@ void GWindow::set_rect(const Rect& a_rect)
request.window_id = m_window_id;
request.window.rect = a_rect;
GEventLoop::current().post_message_to_server(request);
if (m_back_bitmap->size() != a_rect.size())
m_back_bitmap = nullptr;
if (m_front_bitmap->size() != a_rect.size())
m_front_bitmap = nullptr;
if (m_main_widget)
m_main_widget->resize(a_rect.size());
}