From f395097fe90b0deaf5511a5ce748bed0de85b1d8 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Fri, 24 Nov 2017 10:40:16 +0100 Subject: [PATCH] [Containment Interface] Set WA_TranslucentBackground before accessing winId() This would create the surface after which this flag has no effect causing menus to have black rounded corners. CHANGELOG: Fixed an issue where context menus would appear with broken corners CCBUG: 381799 Differential Revision: https://phabricator.kde.org/D8963 --- .../qml/plasmoid/containmentinterface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index ba9795578..5fecfca9c 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -1003,6 +1003,12 @@ void ContainmentInterface::mousePressEvent(QMouseEvent *event) //qDebug() << "Invoking menu for applet" << applet; QMenu *desktopMenu = new QMenu; + + //this is a workaround where Qt now creates the menu widget + //in .exec before oxygen can polish it and set the following attribute + desktopMenu->setAttribute(Qt::WA_TranslucentBackground); + //end workaround + if (desktopMenu->winId()) { desktopMenu->windowHandle()->setTransientParent(window()); } @@ -1019,12 +1025,6 @@ void ContainmentInterface::mousePressEvent(QMouseEvent *event) addContainmentActions(desktopMenu, event); } - //this is a workaround where Qt now creates the menu widget - //in .exec before oxygen can polish it and set the following attribute - desktopMenu->setAttribute(Qt::WA_TranslucentBackground); - //end workaround - - //this is a workaround where Qt will fail to realise a mouse has been released // this happens if a window which does not accept focus spawns a new window that takes focus and X grab