mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
WindowServer+Taskbar: Show applets in taskbar :^)
WindowServer now collects applet windows into an "applet area" which is really just a window that a WM (window management) client can position via IPC. This is rather hackish, and I think we should come up with a better architecture eventually, but this brings back the missing applets since the global menu where they used to live is gone.
This commit is contained in:
parent
44602ae141
commit
9bbc1c9c93
18 changed files with 145 additions and 40 deletions
|
@ -204,6 +204,8 @@ void WindowManager::add_window(Window& window)
|
|||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
if (auto* applet_area_window = AppletManager::the().window())
|
||||
tell_wm_listeners_applet_area_size_changed(applet_area_window->size());
|
||||
}
|
||||
|
||||
window.invalidate(true, true);
|
||||
|
@ -341,6 +343,14 @@ void WindowManager::tell_wm_listeners_window_rect_changed(Window& window)
|
|||
});
|
||||
}
|
||||
|
||||
void WindowManager::tell_wm_listeners_applet_area_size_changed(const Gfx::IntSize& size)
|
||||
{
|
||||
for_each_window_listening_to_wm_events([&](Window& listener) {
|
||||
listener.client()->post_message(Messages::WindowClient::WM_AppletAreaSizeChanged(listener.window_id(), size));
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
}
|
||||
|
||||
static bool window_type_has_title(WindowType type)
|
||||
{
|
||||
return type == WindowType::Normal || type == WindowType::ToolWindow;
|
||||
|
@ -382,7 +392,7 @@ void WindowManager::notify_rect_changed(Window& window, const Gfx::IntRect& old_
|
|||
tell_wm_listeners_window_rect_changed(window);
|
||||
|
||||
if (window.type() == WindowType::MenuApplet)
|
||||
AppletManager::the().calculate_applet_rects(MenuManager::the().window());
|
||||
AppletManager::the().relayout();
|
||||
|
||||
MenuManager::the().refresh();
|
||||
}
|
||||
|
@ -931,7 +941,7 @@ void WindowManager::process_mouse_event(MouseEvent& event, Window*& hovered_wind
|
|||
if (MenuManager::the().has_open_menu()
|
||||
|| hitting_menu_in_window_with_active_menu) {
|
||||
for_each_visible_window_of_type_from_front_to_back(WindowType::MenuApplet, [&](auto& window) {
|
||||
if (!window.rect_in_menubar().contains(event.position()))
|
||||
if (!window.rect_in_applet_area().contains(event.position()))
|
||||
return IterationDecision::Continue;
|
||||
hovered_window = &window;
|
||||
return IterationDecision::Break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue