QCompleter: Set transient parent on popup
In order to properly show a popup the Wayland QPA needs a parent window. Currently it has to guess the parent, which might not work in all circumstances. To address that explicitly set the widget as transient parent of the popup. Fixes: QTBUG-130474 Pick-to: 6.8 Change-Id: I99ea14a1a9ec25ee8a929cf61a6744957a850374 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 81f8eee6a1e1cfcf4bf1f2dac863e94e0f872559) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
9db5beae71
commit
d8fdcea0d1
@ -923,8 +923,13 @@ void QCompleterPrivate::showPopup(const QRect& rect)
|
|||||||
|
|
||||||
popup->setGeometry(pos.x(), pos.y(), w, h);
|
popup->setGeometry(pos.x(), pos.y(), w, h);
|
||||||
|
|
||||||
if (!popup->isVisible())
|
if (!popup->isVisible()) {
|
||||||
|
// Make sure popup has a transient parent set, Wayland needs it. QTBUG-130474
|
||||||
|
popup->winId(); // force creation of windowHandle
|
||||||
|
popup->windowHandle()->setTransientParent(widget->window()->windowHandle());
|
||||||
|
|
||||||
popup->show();
|
popup->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_CONFIG(filesystemmodel)
|
#if QT_CONFIG(filesystemmodel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user