Commit ce166ca4 authored by Martin Klapetek's avatar Martin Klapetek
Browse files

Don't hide Dialog when opening QMenu from it

When plasmoid in a popup (applet opened from panel) is opening a QMenu,
the popup itself hides because it looses focus. There's currently no way
to obtain the Dialog the applet popup is in and pass it to the QMenu
window as a parent, so we have to go this way.

REVIEW: 118361
BUG: 335422
parent aca024c2
......@@ -797,7 +797,7 @@ void Dialog::focusOutEvent(QFocusEvent *ev)
const QWindow *focusWindow = QGuiApplication::focusWindow();
bool childHasFocus = (focusWindow && focusWindow->isActive() && isAncestorOf(focusWindow));
bool childHasFocus = focusWindow && ((focusWindow->isActive() && isAncestorOf(focusWindow)) || focusWindow->objectName() == QLatin1String("QMenuClassWindow"));
if (qobject_cast<const View *>(focusWindow) || (!parentHasFocus && !childHasFocus)) {
qDebug() << "DIALOG: hiding dialog.";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment