Переглянути джерело

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.
Andreas Kling 6 роки тому
батько
коміт
0ac55f2c38
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      LibGUI/GWindow.cpp

+ 4 - 0
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());
 }