mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
WindowServer+LibGUI: Make menubar allocation asynchronous
Same as with menu allocation, move menubar ID management to the client side, removing more IPC stalls during application startup.
This commit is contained in:
parent
baab0a5bef
commit
7e799529b9
4 changed files with 9 additions and 7 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <AK/IDAllocator.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuItem.h>
|
||||
#include <LibGUI/Menubar.h>
|
||||
|
@ -12,6 +13,8 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static IDAllocator s_menubar_id_allocator;
|
||||
|
||||
Menubar::Menubar()
|
||||
{
|
||||
}
|
||||
|
@ -30,7 +33,9 @@ Menu& Menubar::add_menu(String name)
|
|||
|
||||
int Menubar::realize_menubar()
|
||||
{
|
||||
return WindowServerConnection::the().create_menubar();
|
||||
auto menubar_id = s_menubar_id_allocator.allocate();
|
||||
WindowServerConnection::the().async_create_menubar(menubar_id);
|
||||
return menubar_id;
|
||||
}
|
||||
|
||||
void Menubar::unrealize_menubar()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue