Release mouse if Qt doesn't receive mouse release

As explained in commit message for #166, there's a case where Qt
doesn't receive the mouse release from Windows. If that happens
then allow to drop if we're over a drop indicator.

Fixes issue #306
This commit is contained in:
Sergio Martins
2022-08-16 14:28:49 -07:00
parent 7e689f0b39
commit bde5be9d9c

View File

@@ -263,6 +263,7 @@ StateDragging::StateDragging(DragController *parent)
if (!mouseButtonIsReallyDown && isLeftButtonPressed()) {
qCDebug(state) << "Canceling drag, Qt thinks mouse button is pressed"
<< "but Windows knows it's not";
handleMouseButtonRelease(QCursor::pos());
Q_EMIT q->dragCanceled();
}
});