1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Ensure transient parent window for LocationCompleterView

This makes sure that the completer listview is properly positioned on
wayland. Tested with Qt 5.9 RC.

Closes #2344.
This commit is contained in:
Elvis Angelaccio 2017-06-07 16:01:06 +02:00 committed by David Rosca
parent 8dd870bc53
commit 2a2c49ca47

View File

@ -29,6 +29,8 @@
#include "bookmarkitem.h" #include "bookmarkitem.h"
#include "qzsettings.h" #include "qzsettings.h"
#include <QWindow>
LocationCompleterView* LocationCompleter::s_view = 0; LocationCompleterView* LocationCompleter::s_view = 0;
LocationCompleterModel* LocationCompleter::s_model = 0; LocationCompleterModel* LocationCompleter::s_model = 0;
@ -293,6 +295,11 @@ void LocationCompleter::showPopup()
connect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex))); connect(s_view, SIGNAL(indexDeleteRequested(QModelIndex)), this, SLOT(indexDeleteRequested(QModelIndex)));
connect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex))); connect(s_view->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex)));
if (m_locationBar->nativeParentWidget()) {
s_view->createWinId();
s_view->windowHandle()->setTransientParent(m_locationBar->nativeParentWidget()->windowHandle());
}
adjustPopupSize(); adjustPopupSize();
} }