mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:17:35 +00:00
LibGUI: Remember size and position of hidden Windows
And don't reset windowless rects on resize events. Fixes child windows reappearing at [0,0] and with the wrong dimensions after being hidden.
This commit is contained in:
parent
f833473df0
commit
c5dd72ac71
1 changed files with 3 additions and 1 deletions
|
@ -208,6 +208,8 @@ void Window::hide()
|
||||||
if (GUI::Application::in_teardown())
|
if (GUI::Application::in_teardown())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_rect_when_windowless = rect();
|
||||||
|
|
||||||
auto destroyed_window_ids = ConnectionToWindowServer::the().destroy_window(m_window_id);
|
auto destroyed_window_ids = ConnectionToWindowServer::the().destroy_window(m_window_id);
|
||||||
server_did_destroy();
|
server_did_destroy();
|
||||||
|
|
||||||
|
@ -468,7 +470,7 @@ void Window::handle_resize_event(ResizeEvent& event)
|
||||||
m_pending_paint_event_rects.clear_with_capacity();
|
m_pending_paint_event_rects.clear_with_capacity();
|
||||||
m_pending_paint_event_rects.append({ {}, new_size });
|
m_pending_paint_event_rects.append({ {}, new_size });
|
||||||
}
|
}
|
||||||
m_rect_when_windowless = { {}, new_size };
|
m_rect_when_windowless.set_size(new_size);
|
||||||
if (m_main_widget)
|
if (m_main_widget)
|
||||||
m_main_widget->set_relative_rect({ {}, new_size });
|
m_main_widget->set_relative_rect({ {}, new_size });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue