diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-11-17 09:43:19 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-19 16:04:42 +0100 |
commit | 325061b0e4e02b2b177b2e34324339690f5ed93d (patch) | |
tree | 7bfc7a6951c574c2729361c71e6acc6a9e3ebdec /Userland/Services | |
parent | ef7d9c01663dbb7ac1870430017c08e2598a8823 (diff) | |
download | serenity-325061b0e4e02b2b177b2e34324339690f5ed93d.zip |
WindowServer: Add misbehavior restriction for Blocking modals
Two Blocking modals in the same modal chain which aren't descended
one from the other will block each other's input rendering the chain
noninteractive. This has caused confusion in the past for builders so
this warning makes the behavior explicitly forbidden.
Diffstat (limited to 'Userland/Services')
-rw-r--r-- | Userland/Services/WindowServer/ConnectionFromClient.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/ConnectionFromClient.cpp b/Userland/Services/WindowServer/ConnectionFromClient.cpp index f39ca5309d..a715decadb 100644 --- a/Userland/Services/WindowServer/ConnectionFromClient.cpp +++ b/Userland/Services/WindowServer/ConnectionFromClient.cpp @@ -599,6 +599,11 @@ void ConnectionFromClient::create_window(i32 window_id, Gfx::IntRect const& rect did_misbehave("CreateWindow with bad parent_window_id"); return; } + + if (auto* blocker = parent_window->blocking_modal_window(); blocker && mode == (i32)WindowMode::Blocking) { + did_misbehave("CreateWindow with illegal mode: reciprocally blocked"); + return; + } } if (type < 0 || type >= (i32)WindowType::_Count) { |