1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

WindowServer: Broadcast the full window list to new WM listener clients.

This commit is contained in:
Andreas Kling 2019-04-04 13:33:09 +02:00
parent 9e1682c265
commit 1374195a0d
2 changed files with 18 additions and 0 deletions

View file

@ -493,6 +493,14 @@ void WSWindowManager::add_window(WSWindow& window)
if (m_switcher.is_visible() && window.type() != WSWindowType::WindowSwitcher)
m_switcher.refresh();
if (window.listens_to_wm_events()) {
for_each_window([&window] (WSWindow& other_window) {
if (&window != &other_window && other_window.client())
WSMessageLoop::the().post_message(window, make<WSWMWindowAddedEvent>(other_window.client()->client_id(), other_window.window_id(), other_window.title(), other_window.rect(), other_window.is_active()));
return IterationDecision::Continue;
});
}
for_each_window_listening_to_wm_events([&window] (WSWindow& listener) {
if (window.client())
WSMessageLoop::the().post_message(listener, make<WSWMWindowAddedEvent>(window.client()->client_id(), window.window_id(), window.title(), window.rect(), window.is_active()));