mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 18:55:07 +00:00
LibGUI: Fix GMenu submenu shortcut bug.
I was encountering an entire system crash when the window server attempted to do something with the shortcut text on a submenu. This bug only seemed to appear when I had a lone submenu inside of a menu.
This commit is contained in:
parent
ef40ebbe6d
commit
efc2fc6888
1 changed files with 5 additions and 0 deletions
|
@ -113,6 +113,11 @@ int GMenu::realize_menu()
|
|||
request.menu.enabled = true;
|
||||
request.menu.checkable = false;
|
||||
request.menu.checked = false;
|
||||
|
||||
// no shortcut on submenu, make sure this is cleared out
|
||||
request.menu.shortcut_text_length = 0;
|
||||
strcpy(request.menu.shortcut_text, "\0");
|
||||
|
||||
ASSERT(submenu.name().length() < (ssize_t)sizeof(request.text));
|
||||
strcpy(request.text, submenu.name().characters());
|
||||
request.text_length = submenu.name().length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue