1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibGUI+WindowServer: Inform WindowServer about parent/child windows

If a window has another window in its Core::Object ancestor chain,
we now communicate that relationship to WindowServer so that it can
act with awareness of parent/child windows.
This commit is contained in:
Andreas Kling 2020-05-01 22:59:38 +02:00
parent e9b7a51a9a
commit 6228f72b87
7 changed files with 63 additions and 2 deletions

View file

@ -482,4 +482,16 @@ void Window::recalculate_rect()
Core::EventLoop::current().post_event(*this, make<ResizeEvent>(old_rect, m_rect));
}
void Window::add_child_window(Window& child_window)
{
m_child_windows.append(child_window.make_weak_ptr());
}
void Window::set_parent_window(Window& parent_window)
{
ASSERT(!m_parent_window);
m_parent_window = parent_window.make_weak_ptr();
parent_window.add_child_window(*this);
}
}