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.
This commit is contained in:
thankyouverycool 2022-11-17 09:43:19 -05:00 committed by Andreas Kling
parent ef7d9c0166
commit 325061b0e4
Notes: sideshowbarker 2024-07-17 07:19:27 +09:00

View file

@ -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) {