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

Hang during drag and drop [REG]

    XMLWordPrintable

Details

    • Windows
    • 6ef62f7dc (dev), 264dab993 (6.7), b492b6da6 (6.6), bb4f0d32b (tqtc/lts-6.5), 4c31054d3 (tqtc/lts-6.2)

    Description

      Application may hang under certain preconditions during drag and drop.

      It looks like it is caused by this commit https://github.com/qt/qtbase/commit/9ff5b886fade489b7cc268626f518145650f6b2c

      Now it takes a window that is considered under mouse by QWindowsContext.

      The problem if it picks WS_EX_LAYERED window, which is transparent and does not receive any messages, and the application hangs on GetMessage forever.

      This is how QWindowsContext picks a window in short

      1. getWindowUnderPointer() returns target window OR first window under mouse (on desktop) if it has a capture
      2. picked window is then saved to QWindowsContext as under point if it does not have a capture

      So, the problem occurs whenever capture changed between 1 and 2. This happens on mouse release. getWindowUnderPointer() picks layered window (transparent) while capture belongs to the source window. Then capture released in QWindowsPointerHandler::handleCaptureRelease (because of event type QEvent::MouseButtonRelease) and layered window saved in QWindowsPointerHandler::handleEnterLeave (since capture released).

      Sample app attached. Launch and try to drag "Drag me" quickly, e.g., press LMB->short mouse move->release LMB. Try a few times if needed

      Attachments

        1. CMakeLists.txt
          0.3 kB
        2. main.cpp
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            owolff Oliver Wolff
            vengelgardt Vladimir Engelgardt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes