summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/WindowStack.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-17 18:58:33 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-18 17:40:05 +0200
commit2b0e0b602c6ddd2405b5d74a1c90530e2ef44cdf (patch)
treed8615b529022dfe39cd7f8d93769199d461a04f6 /Userland/Services/WindowServer/WindowStack.cpp
parentd0bc3d600278290f67c7815aa92b49bd4989ca67 (diff)
downloadserenity-2b0e0b602c6ddd2405b5d74a1c90530e2ef44cdf.zip
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. :^)
Diffstat (limited to 'Userland/Services/WindowServer/WindowStack.cpp')
-rw-r--r--Userland/Services/WindowServer/WindowStack.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/WindowStack.cpp b/Userland/Services/WindowServer/WindowStack.cpp
index 324e11fa4c..8d610ff5e4 100644
--- a/Userland/Services/WindowServer/WindowStack.cpp
+++ b/Userland/Services/WindowServer/WindowStack.cpp
@@ -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)