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

Race condition when rapidly showing and hiding widgets during drag

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:

                There are no open Gerrit changes