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

WindowServer: Rename Window::outer_stack -> Window::window_stack

Also, make it return a reference as aside from only three special
situations (creating, destroying, and moving a window between stacks)
a window should always be on a window stack. Any access during those
brief situations would be a bug, so we should VERIFY this.
This commit is contained in:
Tom 2021-07-02 13:52:23 -06:00 committed by Andreas Kling
parent 6ec35c91bc
commit 0fcb048448
6 changed files with 46 additions and 42 deletions

View file

@ -319,9 +319,18 @@ public:
const Menubar* menubar() const { return m_menubar; }
void set_menubar(Menubar*);
WindowStack* outer_stack() { return m_outer_stack; }
WindowStack const* outer_stack() const { return m_outer_stack; }
void set_outer_stack(Badge<WindowStack>, WindowStack* stack) { m_outer_stack = stack; }
WindowStack& window_stack()
{
VERIFY(m_window_stack);
return *m_window_stack;
}
WindowStack const& window_stack() const
{
VERIFY(m_window_stack);
return *m_window_stack;
}
bool is_on_any_window_stack(Badge<WindowStack>) const { return m_window_stack != nullptr; }
void set_window_stack(Badge<WindowStack>, WindowStack* stack) { m_window_stack = stack; }
const Vector<Screen*, default_screen_count>& screens() const { return m_screens; }
Vector<Screen*, default_screen_count>& screens() { return m_screens; }
@ -416,7 +425,7 @@ private:
MenuItem* m_window_menu_menubar_visibility_item { nullptr };
Optional<int> m_progress;
bool m_should_show_menubar { true };
WindowStack* m_outer_stack { nullptr };
WindowStack* m_window_stack { nullptr };
RefPtr<Animation> m_animation;
public: