mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibGUI: Don't crash when updating menu item that's not in the window server (#83)
Don't crash when updating menu item that's not in the window server. Menu Items begin with an invalid ID of -1, and only get a valid ID if the menu they are attached to is added to the window server. They don't send updates to the server unless they have a valid ID. Fixes #82
This commit is contained in:
parent
ebf645d72a
commit
9823354754
4 changed files with 7 additions and 2 deletions
|
@ -46,6 +46,8 @@ void GMenuItem::set_checked(bool checked)
|
|||
|
||||
void GMenuItem::update_window_server()
|
||||
{
|
||||
if (m_menu_id < 0)
|
||||
return;
|
||||
auto& action = *m_action;
|
||||
WSAPI_ClientMessage request;
|
||||
request.type = WSAPI_ClientMessage::Type::UpdateMenuItem;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue