<table><tr><td style="">davidedmundson created this revision.<br />davidedmundson added a reviewer: Plasma.<br />Restricted Application added a project: Plasma.<br />Restricted Application added a subscriber: plasma-devel.
</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/D4276" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>QMenuBar::setVisible() only checks isNativeMenuBar on OS X<br />
leading to both the normal in-appmenu and the platform menu both being<br />
visible - especially as KXmlGui explicitly has a setVisible call.</p>
<p>This only affects Qt 5.7.0.<br />
For Qt < 5.7.0 we don't have any DBusMenu support.<br />
For Qt >= 5.7.1 the problem is fixed.</p>
<p>This patch adds a (horrible) event filter on any QMenuBar's and blocks<br />
any setVisible calls.</p>
<p>Qt 5.7.0<br />
void QMenuBar::setVisible(bool visible)<br />
{</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">if (isNativeMenuBar()) {
if (!visible)
QWidget::setVisible(false);
return;
}
QWidget::setVisible(visible);</pre></div>
<p>}</p>
<p>Qt 5.7.1<br />
void QMenuBar::setVisible(bool visible)<br />
{</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">if (isNativeMenuBar()) {
if (!visible)
QWidget::setVisible(false);
return;
}
QWidget::setVisible(visible);</pre></div>
<p>}</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Ran on a system with Qt 5.7.0<br />
No longer get double menus</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R135 Integration for Qt applications in Plasma</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4276" rel="noreferrer">https://phabricator.kde.org/D4276</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/platformtheme/qdbusmenubar.cpp<br />
src/platformtheme/qdbusmenubar_p.h</div></div></div><br /><div><strong>EMAIL PREFERENCES</strong><div><a href="https://phabricator.kde.org/settings/panel/emailpreferences/" rel="noreferrer">https://phabricator.kde.org/settings/panel/emailpreferences/</a></div></div><br /><div><strong>To: </strong>davidedmundson, Plasma<br /><strong>Cc: </strong>plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas<br /></div>