mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 01:15:46 +00:00
Work around rounding error in GFE's mouse position scaling
This commit is contained in:
parent
0df24c76c0
commit
bea625a13d
@ -506,8 +506,14 @@ int LiSendMousePositionEvent(short x, short y, short referenceWidth, short refer
|
||||
holder->packet.mouseMoveAbs.x = htons(x);
|
||||
holder->packet.mouseMoveAbs.y = htons(y);
|
||||
holder->packet.mouseMoveAbs.unused = 0;
|
||||
holder->packet.mouseMoveAbs.width = htons(referenceWidth);
|
||||
holder->packet.mouseMoveAbs.height = htons(referenceHeight);
|
||||
|
||||
// There appears to be a rounding error in GFE's scaling calculation which prevents
|
||||
// the cursor from reaching the far edge of the screen when streaming at smaller
|
||||
// resolutions with a higher desktop resolution (like streaming 720p with a desktop
|
||||
// resolution of 1080p, or streaming 720p/1080p with a desktop resolution of 4K).
|
||||
// Subtracting one from the reference dimensions seems to work around this issue.
|
||||
holder->packet.mouseMoveAbs.width = htons(referenceWidth - 1);
|
||||
holder->packet.mouseMoveAbs.height = htons(referenceHeight - 1);
|
||||
|
||||
err = LbqOfferQueueItem(&packetQueue, holder, &holder->entry);
|
||||
if (err != LBQ_SUCCESS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user