[all] make cursor visible a flag and send it seperate to position

This commit is contained in:
Geoffrey McRae
2020-01-27 02:07:32 +11:00
parent 9d7f773b9c
commit bced5f95ff
5 changed files with 21 additions and 15 deletions

View File

@@ -710,19 +710,21 @@ static CaptureResult dxgi_capture()
frameInfo.PointerPosition.Visible != this->lastPointerVisible
)
{
pointer.positionUpdate = true;
/* the pointer position is invalid if the pointer is not visible */
if (frameInfo.PointerPosition.Visible)
{
this->lastPointerX = frameInfo.PointerPosition.Position.x;
this->lastPointerY = frameInfo.PointerPosition.Position.y;
pointer.positionUpdate = true;
pointer.x =
this->lastPointerX =
frameInfo.PointerPosition.Position.x;
pointer.y =
this->lastPointerY =
frameInfo.PointerPosition.Position.y;
}
this->lastPointerVisible = frameInfo.PointerPosition.Visible;
pointer.x = this->lastPointerX;
pointer.y = this->lastPointerY;
pointer.visible = this->lastPointerVisible;
pointer.visible =
this->lastPointerVisible =
frameInfo.PointerPosition.Visible;
postPointer = true;
}
}

View File

@@ -325,11 +325,13 @@ void capturePostPointerBuffer(CapturePointer pointer)
if (pointer.positionUpdate)
{
flags |= CURSOR_FLAG_POSITION;
cursor->x = pointer.x;
cursor->y = pointer.y;
cursor->visible = pointer.visible;
cursor->x = pointer.x;
cursor->y = pointer.y;
}
if (pointer.visible)
flags |= CURSOR_FLAG_VISIBLE;
if (pointer.shapeUpdate)
{
// remember which slot has the latest shape