From fea0a98b9ed2d65725a01441b05fd8a4b9de3812 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 27 Jan 2020 01:46:43 +1100 Subject: [PATCH] [c-host] dxgi: invisible cursors do not have position information --- VERSION | 2 +- c-host/platform/Windows/capture/DXGI/src/dxgi.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index d30299d8..862683a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-109-gb7e4426002+1 \ No newline at end of file +B1-111-gd860d6b891+1 \ No newline at end of file diff --git a/c-host/platform/Windows/capture/DXGI/src/dxgi.c b/c-host/platform/Windows/capture/DXGI/src/dxgi.c index 2bcb8f0a..1b8126fd 100644 --- a/c-host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/c-host/platform/Windows/capture/DXGI/src/dxgi.c @@ -710,15 +710,19 @@ static CaptureResult dxgi_capture() frameInfo.PointerPosition.Visible != this->lastPointerVisible ) { - pointer.positionUpdate = true; - this->lastPointerX = frameInfo.PointerPosition.Position.x; - this->lastPointerY = frameInfo.PointerPosition.Position.y; + 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; + } this->lastPointerVisible = frameInfo.PointerPosition.Visible; pointer.x = this->lastPointerX; pointer.y = this->lastPointerY; pointer.visible = this->lastPointerVisible; - postPointer = true; } }