[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
This commit is contained in:
Kai Uwe Broulik 2017-11-24 10:40:16 +01:00
parent 1d01cd4393
commit f395097fe9

View File

@ -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