Skip to content

Commit

Permalink
WindowServer: Add const version of Menu::find_menu_by_id(int menu_id)
Browse files Browse the repository at this point in the history
It's a little sad having two diferent versions of this function, but I
don't know of any better way to do it. This also gets rid of some const
casts down the line.
  • Loading branch information
shannonbooth authored and awesomekling committed May 18, 2020
1 parent 08064ed commit 41471eb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Services/WindowServer/ClientConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ class ClientConnection final
return nullptr;
return const_cast<Menu*>(menu.value().ptr());
}
const Menu* find_menu_by_id(int menu_id) const
{
auto menu = m_menus.get(menu_id);
if (!menu.has_value())
return nullptr;
return menu.value().ptr();
}

void notify_display_link(Badge<Compositor>);

Expand Down

0 comments on commit 41471eb

Please sign in to comment.