summaryrefslogtreecommitdiff
path: root/Servers/WindowServer
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-05-04 03:53:52 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-07 22:15:16 +0200
commitcc67671d959f29fccf6bca0f0fcdeaf84b74c3d3 (patch)
treef5be4176a55012ea0025ff11d00a42c6ebfa144b /Servers/WindowServer
parentc1a6841cb23c3d8f9dc4eaa0b01cd0f671200e9e (diff)
downloadserenity-cc67671d959f29fccf6bca0f0fcdeaf84b74c3d3.zip
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.
Diffstat (limited to 'Servers/WindowServer')
-rw-r--r--Servers/WindowServer/Window.cpp9
1 files changed, 8 insertions, 1 deletions
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()