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

Wrong Usage of DoDragDrop() Causes Drag and Drop via Touch to Hang

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.2.7, 6.4.1, 6.5.0 Beta1
    • 5.11.3, 5.15.10, 6.3.1
    • GUI: Drag and Drop
    • None
    • Microsoft Surface 5 and other touch-enabled devices
    • Windows
    • 31e7790102 (qt/qtbase/dev) 31e7790102 (qt/tqtc-qtbase/dev) f35ad8f32f (qt/tqtc-qtbase/6.2) 97c95f606f (qt/qtbase/6.4) 97c95f606f (qt/tqtc-qtbase/6.4) 97c95f606f (qt/tqtc-qtbase/6.4.1) 97c95f606f (qt/tqtc-qtbase/tqtc/qtinsight-6.4)

    Description

      When performing drags in QML with dragType set to Automatic, Qt uses the WinAPI function DoDragDrop() to perform drag and drop operations on Windows (in QWindowsDrag::drag()). The documentation for that function indicates that Qt is using it the wrong way for pen and touch input: "DoDragDrop does not support invoking drag and drop support when you handle touch or pen input.", see the remarks here. I found this out by setting up remote debugging for the test case and hitting pause when the app was hanging.

      For us, this results in touch drag operations which hang until the application gets mouse input or the user presses the ESC key. In our real application we also have situations where users can start a lot of pen drag operations in a short amount of time (they can rearrange a set of items in a small space), which also freezes DnD, I assume that we get somewhat lucky with DoDragDrop() there and it mostly works, except for freezing after performing a lot of these short drag operations.

      In the example you can reproduce this by trying to drag the blue rectangle: with mouse everything woks as expected and the full drag & drop cycle is performed. With touch, no indicator is drawn at the mouse cursor and no pixmap preview is shown, additionally it almost always freezes on the first drag. The video shows that the application freezes as soon as the drag starts (when the output prints "Qt::LeftButton") and that I can get it to unfreeze by moving the mouse.

       

      Attachments

        1. touchanddrag.webm
          21.55 MB
        2. touchreprocase.zip
          2 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              anrocha André De La Rocha (Inactive)
              a.stillich Alexander Stillich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: