Right now, the "appmenutest" application fails to show the "Menu C" item, which is dynamically generated.
(this also happens with LyX, due to the same reason)
After some investigation, I've noted that the following happens:
- User opens a menu
- aboutToShow() signal gets triggered inside the application, which populates the menu
- We call GetLayout() to obtain new layout
- Old menu entries inside the DBusMenuImporter are removed, new menu entries are created
- However, because menu gets empty, it decides to close itself
There is a simple workaround: just populate menu with new items BEFORE removing obsolete items.
Thus menu never gets empty, and does not close itself.