mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-27 01:50:24 +00:00
WindowServer: Broadcast window icons to newly joined WM listener clients.
This commit is contained in:
parent
3817f5f619
commit
b88f2bc799
Notes:
sideshowbarker
2024-07-19 14:39:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b88f2bc7994
2 changed files with 11 additions and 3 deletions
|
@ -273,8 +273,10 @@ void WSWindowManager::add_window(WSWindow& window)
|
|||
|
||||
if (window.listens_to_wm_events()) {
|
||||
for_each_window([&] (WSWindow& other_window) {
|
||||
if (&window != &other_window)
|
||||
if (&window != &other_window) {
|
||||
tell_wm_listener_about_window(window, other_window);
|
||||
tell_wm_listener_about_window_icon(window, other_window);
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
@ -321,6 +323,12 @@ void WSWindowManager::tell_wm_listener_about_window(WSWindow& listener, WSWindow
|
|||
WSEventLoop::the().post_event(listener, make<WSWMWindowStateChangedEvent>(window.client()->client_id(), window.window_id(), window.title(), window.rect(), window.is_active(), window.type(), window.is_minimized()));
|
||||
}
|
||||
|
||||
void WSWindowManager::tell_wm_listener_about_window_icon(WSWindow& listener, WSWindow& window)
|
||||
{
|
||||
if (window.client())
|
||||
WSEventLoop::the().post_event(listener, make<WSWMWindowIconChangedEvent>(window.client()->client_id(), window.window_id(), window.icon_path()));
|
||||
}
|
||||
|
||||
void WSWindowManager::tell_wm_listeners_window_state_changed(WSWindow& window)
|
||||
{
|
||||
for_each_window_listening_to_wm_events([&] (WSWindow& listener) {
|
||||
|
@ -332,8 +340,7 @@ void WSWindowManager::tell_wm_listeners_window_state_changed(WSWindow& window)
|
|||
void WSWindowManager::tell_wm_listeners_window_icon_changed(WSWindow& window)
|
||||
{
|
||||
for_each_window_listening_to_wm_events([&] (WSWindow& listener) {
|
||||
if (window.client())
|
||||
WSEventLoop::the().post_event(listener, make<WSWMWindowIconChangedEvent>(window.client()->client_id(), window.window_id(), window.icon_path()));
|
||||
tell_wm_listener_about_window_icon(listener, window);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -138,6 +138,7 @@ private:
|
|||
void flip_buffers();
|
||||
void tick_clock();
|
||||
void tell_wm_listener_about_window(WSWindow& listener, WSWindow&);
|
||||
void tell_wm_listener_about_window_icon(WSWindow& listener, WSWindow&);
|
||||
void pick_new_active_window();
|
||||
|
||||
WSScreen& m_screen;
|
||||
|
|
Loading…
Reference in a new issue