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
This commit is contained in:
parent
aca024c2e0
commit
ce166ca451
@ -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.";
|
||||
|
Loading…
Reference in New Issue
Block a user