Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.6.0 Beta2
-
None
-
-
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
- getWindowUnderPointer() returns target window OR first window under mouse (on desktop) if it has a capture
- 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
For Gerrit Dashboard: QTBUG-115260 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
506561,6 | Fix hang issue during drag and drop in windows | dev | qt/qtbase | Status: MERGED | +2 | 0 |
525234,2 | Fix hang issue during drag and drop in windows | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
525296,2 | Fix hang issue during drag and drop in windows | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
526050,2 | Fix hang issue during drag and drop in windows | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
526053,2 | Fix hang issue during drag and drop in windows | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |