Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57253

Mouse events are not sent to correct items when offscreen rendering

    XMLWordPrintable

    Details

    • Commits:
      e0c30279ec1fad88346ed3fb483bc3c672fdd01b

      Description

      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).

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-57253
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              anmaatta Antti Määttä
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: