1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

WindowServer+LibGUI: Make menu allocation asynchronous

This was only synchronous since WindowServer managed the ID allocation.
Doing this on the client side instead allows us to make create_menu()
an asynchronous IPC call, removing a bunch of IPC stalls during
application startup.
This commit is contained in:
Andreas Kling 2021-05-17 13:26:40 +02:00
parent 52054eb922
commit baab0a5bef
4 changed files with 9 additions and 7 deletions

View file

@ -99,12 +99,10 @@ void ClientConnection::destroy_menubar(i32 menubar_id)
m_menubars.remove(it);
}
Messages::WindowServer::CreateMenuResponse ClientConnection::create_menu(String const& menu_title)
void ClientConnection::create_menu(i32 menu_id, String const& menu_title)
{
int menu_id = m_next_menu_id++;
auto menu = Menu::construct(this, menu_id, menu_title);
m_menus.set(menu_id, move(menu));
return menu_id;
}
void ClientConnection::destroy_menu(i32 menu_id)