From 0ac55f2c38efccdc795295e4bfa9f2a187ecb1b3 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 10 Apr 2019 14:35:13 +0200 Subject: [PATCH] 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. --- LibGUI/GWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LibGUI/GWindow.cpp b/LibGUI/GWindow.cpp index 59c5710cca..d2f41176ef 100644 --- a/LibGUI/GWindow.cpp +++ b/LibGUI/GWindow.cpp @@ -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()); }