Fix offset when dragging too fast

On Windows, when we start a drag, we switch to native dragging in
mid-flight, so that AeroSnap still works

Fixes #121
This commit is contained in:
Sergio Martins
2021-01-19 22:23:20 +00:00
parent ae14e49338
commit d5b80b0bbd

View File

@@ -261,6 +261,11 @@ void StateDragging::onEntry()
q->m_windowBeingDragged = fw->makeWindow();
QWindow *window = fw->windowHandle();
// Position the window before the drag start, otherwise if you move mouse too fast there will be an offset
window->setPosition(QCursor::pos() - q->m_offset);
// Start the native move
window->startSystemMove();
}
#endif