mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 06:28:13 +00:00
WindowServer+LibGUI: Make much of menu construction asynchronous
Creating a menu/menubar needs to be synchronous because we need the ID from the response, but adding stuff *to* menus (and adding menus to menubars, and menubars to windows) can all be asynchronous. This dramatically reduces the amount of IPC ping-pong played by each GUI application during startup. I measured how long it takes TextEditor to enter the main event loop and it's over 10% faster here. (Down from ~86ms to ~74ms)
This commit is contained in:
parent
8a6db55e79
commit
a8a899adbf
5 changed files with 11 additions and 11 deletions
|
@ -49,7 +49,7 @@ void Menubar::notify_added_to_window(Badge<Window>)
|
|||
for (auto& menu : m_menus) {
|
||||
int menu_id = menu.realize_menu();
|
||||
VERIFY(menu_id != -1);
|
||||
WindowServerConnection::the().add_menu_to_menubar(m_menubar_id, menu_id);
|
||||
WindowServerConnection::the().async_add_menu_to_menubar(m_menubar_id, menu_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue