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

Race condition when rapidly showing and hiding widgets during drag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2
    • QPA: Wayland
    • None

    Description

      Can be reproduced with the example from QTBUG-87624.

      QWaylandWindow::setVisible() calls QWaylandDisplay::flushRequests, which then will process wl_data_device events, calling QGuiApplicationPrivate::processDrag(). If that drag event causes another window to be shown, QGuiApplicationPrivate::processDrag() can get a reentrant call. This causes problems, since processDrag() is not reentrant-safe. (At a minimum it would need to test whether currentDragWindow has changed after each sendEvent().)

      There is a simple workaround: Don't hide/show windows (or do other windowsystem manipulation) directly from drag events. Instead, use QMetaObject::invokeMethod with QueuedConnection.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              tvete Paul Olav Tvete
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes