Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2
-
None
Description
Let's say we have:
QWebEngineView *view; QWebEnginePage *page1; QWebEnginePage *page2;
And the view alternates between showing page1 and page2.
Each call like
// view is showing pageX view->setPage(pageY); // view is now showing pageY
will move the internal focus of pageX if the view had the focus when setPage() is called.
I have attached to this ticket a minimal app showing the issue and a video recording of this app.
My understanding of the causes is that when changing the page of a QWebEngineView, its internal QQuickWidget is hidden and deleted.
When it is hidden, QWidgetPrivate::hide_helper() is called.
Because the QQuickWidget being hidden has focus, QWidgetPrivate::hide_helper() will then call QQuickWidget::focusNextPrevChild().
Then QQuickWidget::focusNextPrevChild() will send a tab down and a tab up event to its internal QQuickView that will end up forwarded to the QWebEnginePage.
I was able to see the tab events in GammaRay and in Chromium, using JS to listen to key events in the DOM.