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:
parent
d4818dd2dd
commit
0ac55f2c38
1 changed files with 4 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue