Commit 37206c2b authored by Joerg Bornemann's avatar Joerg Bornemann Committed by Allan Sandfeld Jensen
Browse files

Fix Q_ASSERT when dragging an item over WebEngineView


When dragging something over a WebEngineView we're waiting for the
result of the asynchronous DragTargetDragOver using a RunLoop. The
result will be delivered by a call to updateDragAction.

The RunLoop will call MessagePumpForUIQt::Run which spins a QEventLoop.
The QEventLoop will dispatch more posted QDragMoveEvent objects while
we're handling the current QDragMoveEvent. This triggers a recursion
guard's Q_ASSERT when dragging from a QtQuick item onto a WebEngineView.

When waiting for the DragTargetDragOver result we're not interested in
Qt events. Instead of using a RunLoop, implement a poor man's chromium
event loop and actively wait for updateDragAction being called.

In practice, no more than two iterations of the loop are run until
updateDragAction is called. Therefore the extra CPU and sleep times are
negligible.

Task-number: QTBUG-58920
Change-Id: Icfdf9c680c4c9987ac3dbb41fbc3e1403af0fa9f
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: default avatarAlexandru Croitor <alexandru.croitor@qt.io>
Showing with 26 additions and 62 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment