summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/Window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI/Window.cpp')
-rw-r--r--Libraries/LibGUI/Window.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp
index ead7ba78fa..60d80d938e 100644
--- a/Libraries/LibGUI/Window.cpp
+++ b/Libraries/LibGUI/Window.cpp
@@ -89,6 +89,9 @@ void Window::show()
{
if (is_visible())
return;
+
+ auto* parent_window = find_parent_window();
+
m_override_cursor = StandardCursor::None;
auto response = WindowServerConnection::the().send_sync<Messages::WindowServer::CreateWindow>(
m_rect_when_windowless,
@@ -102,7 +105,8 @@ void Window::show()
m_base_size,
m_size_increment,
(i32)m_window_type,
- m_title_when_windowless);
+ m_title_when_windowless,
+ parent_window ? parent_window->window_id() : 0);
m_window_id = response->window_id();
m_visible = true;
@@ -113,6 +117,15 @@ void Window::show()
update();
}
+Window* Window::find_parent_window()
+{
+ for (auto* ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
+ if (ancestor->is_window())
+ return static_cast<Window*>(ancestor);
+ }
+ return nullptr;
+}
+
void Window::hide()
{
if (!is_visible())