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