1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

WindowServer: Remove the global app menu

The SetApplicationMenu IPC message is still there, since we also need
to clean up all of the client code before we can remove that.
This commit is contained in:
Andreas Kling 2021-03-25 21:19:05 +01:00
parent 05cc7d69ac
commit fcc8e3484f
6 changed files with 3 additions and 48 deletions

View file

@ -54,7 +54,6 @@ MenuManager::MenuManager()
s_the = this;
m_needs_window_resize = true;
// NOTE: This ensures that the system menu has the correct dimensions.
set_current_menubar(nullptr);
m_window = Window::construct(*this, WindowType::Menubar);
@ -498,15 +497,8 @@ Gfx::IntRect MenuManager::menubar_rect() const
return { 0, 0, Screen::the().rect().width(), 19 };
}
void MenuManager::set_current_menubar(MenuBar* menubar)
void MenuManager::set_current_menubar(MenuBar*)
{
if (menubar)
m_current_menubar = *menubar;
else
m_current_menubar = nullptr;
dbgln_if(MENUS_DEBUG, "[WM] Current menubar is now {}", menubar);
Gfx::IntPoint next_menu_location { MenuManager::menubar_menu_margin() / 2, 0 };
for_each_active_menubar_menu([&](Menu& menu) {
int text_width = menu.title_font().width(menu.name());
@ -521,16 +513,10 @@ void MenuManager::set_current_menubar(MenuBar* menubar)
refresh();
}
void MenuManager::close_menubar(MenuBar& menubar)
{
if (current_menubar() == &menubar)
set_current_menubar(nullptr);
}
void MenuManager::set_system_menu(Menu& menu)
{
m_system_menu = menu;
set_current_menubar(m_current_menubar);
set_current_menubar(nullptr);
}
Menu* MenuManager::previous_menu(Menu* current)