mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +01:00
WebView: Fix finding correct rwhvqt
Focus proxy is actually set only after adding it to the layout, so without the timer it would pick old rwhvqt. BUG: 393398
This commit is contained in:
parent
af89a1b8d4
commit
ad2466f2fa
@ -1292,12 +1292,16 @@ bool WebView::eventFilter(QObject *obj, QEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hack to find widget that receives input events
|
// Hack to find widget that receives input events
|
||||||
if (obj == this && event->type() == QEvent::ChildAdded && !m_rwhvqt && focusProxy()) {
|
if (obj == this && event->type() == QEvent::ChildAdded) {
|
||||||
m_rwhvqt = focusProxy();
|
QTimer::singleShot(0, this, [this]() {
|
||||||
m_rwhvqt->installEventFilter(this);
|
if (focusProxy() && m_rwhvqt != focusProxy()) {
|
||||||
if (QQuickWidget *w = qobject_cast<QQuickWidget*>(m_rwhvqt)) {
|
m_rwhvqt = focusProxy();
|
||||||
w->setClearColor(palette().color(QPalette::Window));
|
m_rwhvqt->installEventFilter(this);
|
||||||
}
|
if (QQuickWidget *w = qobject_cast<QQuickWidget*>(m_rwhvqt)) {
|
||||||
|
w->setClearColor(palette().color(QPalette::Window));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward events to WebView
|
// Forward events to WebView
|
||||||
|
Loading…
Reference in New Issue
Block a user