mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:17:46 +00:00
WindowServer: Add modeless_ancestor() helper
This commit is contained in:
parent
ab517aa21d
commit
609391b46e
2 changed files with 12 additions and 0 deletions
|
@ -989,6 +989,17 @@ void Window::set_parent_window(Window& parent_window)
|
|||
parent_window.add_child_window(*this);
|
||||
}
|
||||
|
||||
Window* Window::modeless_ancestor()
|
||||
{
|
||||
if (!is_modal())
|
||||
return this;
|
||||
for (auto parent = m_parent_window; parent; parent = parent->parent_window()) {
|
||||
if (!parent->is_modal())
|
||||
return parent;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Window::is_accessory() const
|
||||
{
|
||||
if (!m_accessory)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue