[c-host] dxgi: dont send null movements when only the visibility changed

This commit is contained in:
Geoffrey McRae 2020-02-12 18:40:28 +11:00
parent e2adbaa5c1
commit 582ed6b5d1
2 changed files with 16 additions and 17 deletions

View File

@ -1 +1 @@
B1-156-g4acf800ace+1 B1-157-ge2adbaa5c1+1

View File

@ -706,14 +706,10 @@ static CaptureResult dxgi_capture()
if (frameInfo.LastMouseUpdateTime.QuadPart) if (frameInfo.LastMouseUpdateTime.QuadPart)
{ {
if ( /* the pointer position is only valid if the pointer is visible */
frameInfo.PointerPosition.Position.x != this->lastPointerX || if (frameInfo.PointerPosition.Visible &&
frameInfo.PointerPosition.Position.y != this->lastPointerY || (frameInfo.PointerPosition.Position.x != this->lastPointerX ||
frameInfo.PointerPosition.Visible != this->lastPointerVisible frameInfo.PointerPosition.Position.y != this->lastPointerY))
)
{
/* the pointer position is invalid if the pointer is not visible */
if (frameInfo.PointerPosition.Visible)
{ {
pointer.positionUpdate = true; pointer.positionUpdate = true;
pointer.x = pointer.x =
@ -722,8 +718,11 @@ static CaptureResult dxgi_capture()
pointer.y = pointer.y =
this->lastPointerY = this->lastPointerY =
frameInfo.PointerPosition.Position.y; frameInfo.PointerPosition.Position.y;
postPointer = true;
} }
if (this->lastPointerVisible != frameInfo.PointerPosition.Visible)
{
this->lastPointerVisible = frameInfo.PointerPosition.Visible; this->lastPointerVisible = frameInfo.PointerPosition.Visible;
postPointer = true; postPointer = true;
} }