diff --git a/Servers/WindowServer/WSMenuBarKeeper.cpp b/Servers/WindowServer/WSMenuBarKeeper.cpp index 3a7e279a87d..50a88f274cf 100644 --- a/Servers/WindowServer/WSMenuBarKeeper.cpp +++ b/Servers/WindowServer/WSMenuBarKeeper.cpp @@ -6,7 +6,7 @@ #include #include -WSMenuBarKeeper::WSMenuBarKeeper() +WSMenuManager::WSMenuManager() { m_username = getlogin(); @@ -21,17 +21,17 @@ WSMenuBarKeeper::WSMenuBarKeeper() }); } -WSMenuBarKeeper::~WSMenuBarKeeper() +WSMenuManager::~WSMenuManager() { } -void WSMenuBarKeeper::setup() +void WSMenuManager::setup() { m_window = make(*this, WSWindowType::Menubar); m_window->set_rect(WSWindowManager::the().menubar_rect()); } -void WSMenuBarKeeper::draw() +void WSMenuManager::draw() { auto& wm = WSWindowManager::the(); auto menubar_rect = wm.menubar_rect(); @@ -89,12 +89,12 @@ void WSMenuBarKeeper::draw() m_cpu_monitor.paint(painter, cpu_rect); } -void WSMenuBarKeeper::tick_clock() +void WSMenuManager::tick_clock() { refresh(); } -void WSMenuBarKeeper::refresh() +void WSMenuManager::refresh() { if (!m_window) return; @@ -102,7 +102,7 @@ void WSMenuBarKeeper::refresh() window().invalidate(); } -void WSMenuBarKeeper::event(CEvent& event) +void WSMenuManager::event(CEvent& event) { if (event.type() == WSEvent::MouseMove || event.type() == WSEvent::MouseUp || event.type() == WSEvent::MouseDown || event.type() == WSEvent::MouseWheel) { auto& mouse_event = static_cast(event); @@ -117,7 +117,7 @@ void WSMenuBarKeeper::event(CEvent& event) return CObject::event(event); } -void WSMenuBarKeeper::handle_menu_mouse_event(WSMenu& menu, const WSMouseEvent& event) +void WSMenuManager::handle_menu_mouse_event(WSMenu& menu, const WSMouseEvent& event) { auto& wm = WSWindowManager::the(); bool is_hover_with_any_menu_open = event.type() == WSMouseEvent::MouseMove && wm.current_menu() && (wm.current_menu()->menubar() || wm.current_menu() == wm.system_menu()); diff --git a/Servers/WindowServer/WSMenuBarKeeper.h b/Servers/WindowServer/WSMenuBarKeeper.h index 8f34b78b60f..fb6268ef87c 100644 --- a/Servers/WindowServer/WSMenuBarKeeper.h +++ b/Servers/WindowServer/WSMenuBarKeeper.h @@ -4,16 +4,16 @@ #include #include -class WSMenuBarKeeper final : public CObject { +class WSMenuManager final : public CObject { public: - WSMenuBarKeeper(); - virtual ~WSMenuBarKeeper() override; + WSMenuManager(); + virtual ~WSMenuManager() override; void setup(); void refresh(); virtual void event(CEvent&) override; - virtual const char* class_name() const override { return "WSMenuBarKeeper"; } + virtual const char* class_name() const override { return "WSMenuManager"; } private: WSWindow& window() { return *m_window; } diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index a6076965615..cb5522186e9 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -102,7 +102,7 @@ WSWindowManager::WSWindowManager() // NOTE: This ensures that the system menu has the correct dimensions. set_current_menubar(nullptr); - m_menubar_keeper.setup(); + m_menu_manager.setup(); invalidate(); WSCompositor::the().compose(); @@ -239,7 +239,7 @@ void WSWindowManager::set_current_menubar(WSMenuBar* menubar) ++index; return true; }); - m_menubar_keeper.refresh(); + m_menu_manager.refresh(); } void WSWindowManager::add_window(WSWindow& window) @@ -392,7 +392,7 @@ void WSWindowManager::close_current_menu() if (m_current_menu && m_current_menu->menu_window()) m_current_menu->menu_window()->set_visible(false); m_current_menu = nullptr; - m_menubar_keeper.refresh(); + m_menu_manager.refresh(); } void WSWindowManager::start_window_drag(WSWindow& window, const WSMouseEvent& event) @@ -682,7 +682,7 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& hovere } if (menubar_rect().contains(event.position())) { - m_menubar_keeper.event(event); + m_menu_manager.event(event); return; } if (m_current_menu && m_current_menu->menu_window()) { @@ -987,7 +987,7 @@ void WSWindowManager::notify_client_changed_app_menubar(WSClientConnection& clie { if (active_client() == &client) set_current_menubar(client.app_menubar()); - m_menubar_keeper.refresh(); + m_menu_manager.refresh(); } const WSCursor& WSWindowManager::active_cursor() const diff --git a/Servers/WindowServer/WSWindowManager.h b/Servers/WindowServer/WSWindowManager.h index ab41c318d5b..2e85a2b27f7 100644 --- a/Servers/WindowServer/WSWindowManager.h +++ b/Servers/WindowServer/WSWindowManager.h @@ -241,7 +241,7 @@ private: WeakPtr m_current_menu; WSWindowSwitcher m_switcher; - WSMenuBarKeeper m_menubar_keeper; + WSMenuManager m_menu_manager; WeakPtr m_cursor_tracking_button; WeakPtr m_hovered_button;