When using QQuickRenderControl to render QQuickItems to offscreen window, the events send to the controls in the items(generated by the application) are not sent to the items in the offscreen window, but instead to the visible application window item.
This was discovered when implementing render-qml-to-texture feature for Qt3D, where the application can specify qml or QQuickItem to render to texture and also use the controls in them, where the mouse events are generated from pick events from 3D scene.
This was still working a while ago, but not anymore. I turns out that the recent changes to QQuickWindow mouse grab handling breaks this, specifically reusing the QQuickPointerEvent in QQuickPointerDevice. This somehow causes the visible and offscreen windows to share the grabber item.
I was able to make it work again, by having window specific QQuickPointerEvent pointer and passing that to QQuickPointerDevice::pointerEvent, which allocates new device specific event if it is not already allocated(or the passed pointer if it has been allocated).
|For Gerrit Dashboard: QTBUG-57253|
|188970,2||Scene2D::sceneChangeEvent: handle grabMouse||5.9||qt/qt3d||Status: MERGED||+2||0|
|188983,3||Fix scene2d mouse event coordinate calculation||5.9||qt/qt3d||Status: MERGED||+2||0|
|193911,9||Move pointerEvent instance to QQuickWindow||5.9.0||qt/qtdeclarative||Status: MERGED||+2||0|
|194106,1||WIP Move pointerEvent instance to QQuickWindow||wip/pointerhandler||qt/qtdeclarative||Status: ABANDONED||-2||0|
|194403,2||Fix compile due to change in private API in qtdeclarative||5.9.0||qt/qtlocation||Status: MERGED||+2||0|
|194412,1||tests: disable QDeclarativeGeoMap::sendTouchEvent() temporarily||5.9.0||qt/qtlocation||Status: ABANDONED||0||0|
|194417,4||Temporarily restore QQuickPointerDevice::pointerEvent() accessor||5.9.0||qt/qtdeclarative||Status: MERGED||+2||0|
|194419,4||Revert "Temporarily restore QQuickPointerDevice::pointerEvent() accessor"||5.9.0||qt/qtdeclarative||Status: MERGED||+2||0|
|322242,2||Stop ungrabbing due to FocusAboutToChange||dev||qt/qtdeclarative||Status: MERGED||+2||0|