mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:05:08 +00:00
WindowServer: Add special treatment for modal windows.
While a WSClientConnection has a modal window showing, non-modal windows belonging to that client are not sent any events.
This commit is contained in:
parent
57ff293a51
commit
43304d2adf
13 changed files with 89 additions and 17 deletions
|
@ -350,8 +350,9 @@ void WSClientConnection::handle_request(WSAPIGetClipboardContentsRequest&)
|
|||
void WSClientConnection::handle_request(WSAPICreateWindowRequest& request)
|
||||
{
|
||||
int window_id = m_next_window_id++;
|
||||
auto window = make<WSWindow>(*this, window_id);
|
||||
auto window = make<WSWindow>(*this, window_id, request.is_modal());
|
||||
window->set_has_alpha_channel(request.has_alpha_channel());
|
||||
window->set_resizable(request.is_resizable());
|
||||
window->set_title(request.title());
|
||||
window->set_rect(request.rect());
|
||||
window->set_opacity(request.opacity());
|
||||
|
@ -531,3 +532,13 @@ void WSClientConnection::on_request(WSAPIClientRequest& request)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool WSClientConnection::is_showing_modal_window() const
|
||||
{
|
||||
for (auto& it : m_windows) {
|
||||
auto& window = *it.value;
|
||||
if (window.is_visible() && window.is_modal())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue