From 6e70ba7d1d47b29ee6da020075d75f077a369514 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 27 Feb 2019 18:52:12 +0100 Subject: [PATCH] LibGUI: GWindow should only discard the backing store on actual resize. --- LibGUI/GWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LibGUI/GWindow.cpp b/LibGUI/GWindow.cpp index 7bcca70015..4e830e9a2c 100644 --- a/LibGUI/GWindow.cpp +++ b/LibGUI/GWindow.cpp @@ -234,10 +234,12 @@ void GWindow::event(GEvent& event) } if (event.type() == GEvent::Resize) { - m_backing = nullptr; + auto new_size = static_cast(event).size(); + if (m_backing && m_backing->size() != new_size) + m_backing = nullptr; m_pending_paint_event_rects.clear(); - m_rect_when_windowless = { { }, static_cast(event).size() }; - m_main_widget->set_relative_rect({ { }, static_cast(event).size() }); + m_rect_when_windowless = { { }, new_size }; + m_main_widget->set_relative_rect({ { }, new_size }); return; }