Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.9.2
-
None
-
Windows 10, Visual Studio 2017, rendering QML to an offscreen surface using OpenGL 4.5
Description
When rendering QML containing a WebEngineView to an offscreen surface via QQuickRenderControl, if you have a simple page containing a select tag ([like this one|https://hifi-content.s3.amazonaws.com/liv/dev/demo/demo.html)] and you click on the select tag, the popup window created appears on the desktop.
This means that if you're rendering offscreen for presentation in a 3D scene (for instance, for VR HMD UI, or for a Qt 3D scene) popup doesn't appear at all in the offscreen surface and may not actually be visible to the user (if they're using an HMD). Even if you're rendering the offscreen content to a 2D surface, since the window used for rendering has no real desktop coordinates, the popup can appear completely in the wrong place, as seen in the screenshot.
The core issue seems to be in `QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup` which queries the platform integration for the ability to create multiple windows in order to determine whether the new popup should be a top level window or not.
Ideally a WebEngineView should have some context information that it could use to determine whether it was rendering to a real window or an offscreen surface, and should add a test for that to set `hasWindowCapability` to false if the latter.