plugins/mousepad: wait for a microsecond to allow interpolation

This commit is contained in:
Piyush Aggarwal 2021-06-02 01:11:19 +05:30
parent c00ea12007
commit 92237d416e

View file

@ -8,6 +8,8 @@
#include <QCursor>
#include <QDebug>
#include <chrono>
#include <thread>
#include <Windows.h>
@ -237,9 +239,9 @@ bool WindowsRemoteInput::handlePacket(const NetworkPacket& np)
} else { //Is a mouse move event
POINT point;
if (GetCursorPos(&point)) {
return SetCursorPos(point.x + (int)dx, point.y + (int)dy);
} else {
return false;
SetCursorPos(point.x + (int)dx, point.y + (int)dy);
// wait for a microsecond here to allow Windows to interpolate
std::this_thread::sleep_for(std::chrono::microseconds(1));
}
}
return true;