From cc67671d959f29fccf6bca0f0fcdeaf84b74c3d3 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 4 May 2020 03:53:52 +0200 Subject: [PATCH] WindowServer: Don't block child-windows of modal windows ComboBox creates a regular (non-modal) window; I believe this is fine. A Dialog (modal window) can contain a ComboBox; I believe this is fine. A non-modal child window of a modal window (e.g. a ComboBox pop-out within a Dialog) wasn't clickable, and was blocked in the WindowManager. I want to change this behavior. This edge case occurs when trying to select a month in the "Calendar" Application. --- Servers/WindowServer/Window.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Servers/WindowServer/Window.cpp b/Servers/WindowServer/Window.cpp index 4f24dfb7af..4d506e1dc7 100644 --- a/Servers/WindowServer/Window.cpp +++ b/Servers/WindowServer/Window.cpp @@ -362,7 +362,14 @@ bool Window::is_active() const bool Window::is_blocked_by_modal_window() const { - return !is_modal() && client() && client()->is_showing_modal_window(); + bool is_any_modal = false; + const Window* next = this; + while (!is_any_modal && next) { + is_any_modal = next->is_modal(); + next = next->parent_window(); + } + + return !is_any_modal && client() && client()->is_showing_modal_window(); } void Window::set_default_icon()