D15637: Make DBusMenu work correctly with dynamically generated menus

Igor Poboiko noreply at phabricator.kde.org
Fri Sep 21 09:38:46 BST 2018


poboiko created this revision.
poboiko added reviewers: Plasma, broulik.
Herald added a project: Plasma.
poboiko requested review of this revision.

REVISION SUMMARY
  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:
  
  1. User opens a menu
  2. aboutToShow() signal gets triggered inside the application, which populates the menu
  3. We call GetLayout() to obtain new layout
  4. Old menu entries inside the `DBusMenuImporter` are removed, new menu entries are created
  5. 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.

TEST PLAN
  LyX and appmenutest are now working again!

REPOSITORY
  R120 Plasma Workspace

BRANCH
  dbusmenu-bug (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D15637

AFFECTED FILES
  libdbusmenuqt/dbusmenuimporter.cpp

To: poboiko, #plasma, broulik
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180921/fb5fa6c9/attachment.html>


More information about the Plasma-devel mailing list