<table><tr><td style="">poboiko created this revision.<br />poboiko added reviewers: Plasma, broulik.<br />Herald added a project: Plasma.<br />poboiko requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15637">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Right now, the "appmenutest" application fails to show the "Menu C" item, which is dynamically generated.<br />
(this also happens with LyX, due to the same reason)</p>

<p>After some investigation, I've noted that the following happens:</p>

<ol class="remarkup-list">
<li class="remarkup-list-item">User opens a menu</li>
<li class="remarkup-list-item">aboutToShow() signal gets triggered inside the application, which populates the menu</li>
<li class="remarkup-list-item">We call GetLayout() to obtain new layout</li>
<li class="remarkup-list-item">Old menu entries inside the <tt style="background: #ebebeb; font-size: 13px;">DBusMenuImporter</tt> are removed, new menu entries are created</li>
<li class="remarkup-list-item">However, because menu gets empty, it decides to close itself</li>
</ol>

<p>There is a simple workaround: just populate menu with new items BEFORE removing obsolete items.<br />
Thus menu never gets empty, and does not close itself.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>LyX and appmenutest are now working again!</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>BRANCH</strong><div><div>dbusmenu-bug (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15637">https://phabricator.kde.org/D15637</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>libdbusmenuqt/dbusmenuimporter.cpp</div></div></div><br /><div><strong>To: </strong>poboiko, Plasma, broulik<br /><strong>Cc: </strong>plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>