1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

WindowServer: Keep track of which WindowStack a Window is part of

Each Window now knows which WindowStack it's part of. We call this the
Window::outer_stack(), in preparation for supporting inner stacks. :^)
This commit is contained in:
Andreas Kling 2021-06-17 18:58:33 +02:00
parent d0bc3d6002
commit 2b0e0b602c
3 changed files with 11 additions and 1 deletions

View file

@ -18,12 +18,16 @@ WindowStack::~WindowStack()
void WindowStack::add(Window& window)
{
VERIFY(window.outer_stack() == nullptr);
m_windows.append(window);
window.set_outer_stack({}, this);
}
void WindowStack::remove(Window& window)
{
VERIFY(window.outer_stack() == this);
m_windows.remove(window);
window.set_outer_stack({}, nullptr);
}
void WindowStack::move_to_front(Window& window)