[Differential] [Request, 44 lines] D4276: Add workaround for QMenuBar::setVisible bug in 5.7.0
David Edmundson
noreply at phabricator.kde.org
Wed Jan 25 12:05:39 UTC 2017
davidedmundson created this revision.
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.
REVISION SUMMARY
QMenuBar::setVisible() only checks isNativeMenuBar on OS X
leading to both the normal in-appmenu and the platform menu both being
visible - especially as KXmlGui explicitly has a setVisible call.
This only affects Qt 5.7.0.
For Qt < 5.7.0 we don't have any DBusMenu support.
For Qt >= 5.7.1 the problem is fixed.
This patch adds a (horrible) event filter on any QMenuBar's and blocks
any setVisible calls.
Qt 5.7.0
void QMenuBar::setVisible(bool visible)
{
if (isNativeMenuBar()) {
if (!visible)
QWidget::setVisible(false);
return;
}
QWidget::setVisible(visible);
}
Qt 5.7.1
void QMenuBar::setVisible(bool visible)
{
if (isNativeMenuBar()) {
if (!visible)
QWidget::setVisible(false);
return;
}
QWidget::setVisible(visible);
}
TEST PLAN
Ran on a system with Qt 5.7.0
No longer get double menus
REPOSITORY
R135 Integration for Qt applications in Plasma
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D4276
AFFECTED FILES
src/platformtheme/qdbusmenubar.cpp
src/platformtheme/qdbusmenubar_p.h
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: davidedmundson, #plasma
Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170125/17267976/attachment.html>
More information about the Plasma-devel
mailing list