1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +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

@ -113,6 +113,7 @@ private:
template<typename Callback> IterationDecision for_each_visible_window_from_front_to_back(Callback);
template<typename Callback> IterationDecision for_each_visible_window_from_back_to_front(Callback);
template<typename Callback> void for_each_window_listening_to_wm_events(Callback);
template<typename Callback> void for_each_window(Callback);
template<typename Callback> void for_each_active_menubar_menu(Callback);
void close_current_menu();
virtual void on_message(const WSMessage&) override;
@ -278,3 +279,12 @@ void WSWindowManager::for_each_window_listening_to_wm_events(Callback callback)
return;
}
}
template<typename Callback>
void WSWindowManager::for_each_window(Callback callback)
{
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
if (callback(*window) == IterationDecision::Abort)
return;
}
}