mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-24 13:47:04 +00:00
[host] fixed missed cursor shape updates
This commit is contained in:
parent
62e67c345c
commit
871aee2aae
@ -608,7 +608,6 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
|||||||
IDXGIResourcePtr res;
|
IDXGIResourcePtr res;
|
||||||
|
|
||||||
HRESULT status;
|
HRESULT status;
|
||||||
bool cursorUpdate = false;
|
|
||||||
for (int i = 0; i < 2; ++i)
|
for (int i = 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
@ -652,8 +651,8 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
|||||||
m_lastMousePos.x != frameInfo.PointerPosition.Position.x ||
|
m_lastMousePos.x != frameInfo.PointerPosition.Position.x ||
|
||||||
m_lastMousePos.y != frameInfo.PointerPosition.Position.y
|
m_lastMousePos.y != frameInfo.PointerPosition.Position.y
|
||||||
) {
|
) {
|
||||||
cursorUpdate = true;
|
cursor.updated = true;
|
||||||
cursor.hasPos = true;
|
cursor.hasPos = true;
|
||||||
cursor.x = frameInfo.PointerPosition.Position.x;
|
cursor.x = frameInfo.PointerPosition.Position.x;
|
||||||
cursor.y = frameInfo.PointerPosition.Position.y;
|
cursor.y = frameInfo.PointerPosition.Position.y;
|
||||||
m_lastMousePos.x = frameInfo.PointerPosition.Position.x;
|
m_lastMousePos.x = frameInfo.PointerPosition.Position.x;
|
||||||
@ -662,7 +661,7 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
|||||||
|
|
||||||
if (m_lastMouseVis != frameInfo.PointerPosition.Visible)
|
if (m_lastMouseVis != frameInfo.PointerPosition.Visible)
|
||||||
{
|
{
|
||||||
cursorUpdate = true;
|
cursor.updated = true;
|
||||||
m_lastMouseVis = frameInfo.PointerPosition.Visible;
|
m_lastMouseVis = frameInfo.PointerPosition.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,7 +671,7 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
|||||||
// if the pointer shape has changed
|
// if the pointer shape has changed
|
||||||
if (frameInfo.PointerShapeBufferSize > 0)
|
if (frameInfo.PointerShapeBufferSize > 0)
|
||||||
{
|
{
|
||||||
cursorUpdate = true;
|
cursor.updated = true;
|
||||||
if (m_pointerBufSize < frameInfo.PointerShapeBufferSize)
|
if (m_pointerBufSize < frameInfo.PointerShapeBufferSize)
|
||||||
{
|
{
|
||||||
if (m_pointer)
|
if (m_pointer)
|
||||||
@ -713,7 +712,7 @@ GrabStatus Capture::DXGI::GrabFrameTexture(struct FrameInfo & frame, struct Curs
|
|||||||
|
|
||||||
SafeRelease(&res);
|
SafeRelease(&res);
|
||||||
|
|
||||||
if (cursorUpdate)
|
if (cursor.updated)
|
||||||
return GRAB_STATUS_CURSOR;
|
return GRAB_STATUS_CURSOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
struct CursorInfo
|
struct CursorInfo
|
||||||
{
|
{
|
||||||
|
bool updated;
|
||||||
|
|
||||||
bool visible;
|
bool visible;
|
||||||
bool hasShape;
|
bool hasShape;
|
||||||
bool hasPos;
|
bool hasPos;
|
||||||
|
@ -275,10 +275,28 @@ bool Service::Process()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cursor.hasPos || cursor.hasShape)
|
if (cursor.updated)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&m_cursorCS);
|
EnterCriticalSection(&m_cursorCS);
|
||||||
memcpy(&m_cursorInfo, &cursor, sizeof(struct CursorInfo));
|
if (cursor.hasPos)
|
||||||
|
{
|
||||||
|
m_cursorInfo.hasPos = true;
|
||||||
|
m_cursorInfo.x = cursor.x;
|
||||||
|
m_cursorInfo.y = cursor.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cursor.hasShape)
|
||||||
|
{
|
||||||
|
m_cursorInfo.hasShape = true;
|
||||||
|
m_cursorInfo.dataSize = cursor.dataSize;
|
||||||
|
m_cursorInfo.type = cursor.type;
|
||||||
|
m_cursorInfo.w = cursor.w;
|
||||||
|
m_cursorInfo.h = cursor.h;
|
||||||
|
m_cursorInfo.pitch = cursor.pitch;
|
||||||
|
m_cursorInfo.shape = cursor.shape;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_cursorInfo.visible = cursor.visible;
|
||||||
LeaveCriticalSection(&m_cursorCS);
|
LeaveCriticalSection(&m_cursorCS);
|
||||||
SetEvent(m_cursorEvent);
|
SetEvent(m_cursorEvent);
|
||||||
}
|
}
|
||||||
@ -326,6 +344,8 @@ DWORD Service::CursorThread()
|
|||||||
EnterCriticalSection(&m_cursorCS);
|
EnterCriticalSection(&m_cursorCS);
|
||||||
if (m_cursorInfo.hasPos)
|
if (m_cursorInfo.hasPos)
|
||||||
{
|
{
|
||||||
|
m_cursorInfo.hasPos = false;
|
||||||
|
|
||||||
// tell the client where the cursor is
|
// tell the client where the cursor is
|
||||||
cursor->flags |= KVMFR_CURSOR_FLAG_POS;
|
cursor->flags |= KVMFR_CURSOR_FLAG_POS;
|
||||||
cursor->x = m_cursorInfo.x;
|
cursor->x = m_cursorInfo.x;
|
||||||
@ -339,6 +359,7 @@ DWORD Service::CursorThread()
|
|||||||
|
|
||||||
if (m_cursorInfo.hasShape)
|
if (m_cursorInfo.hasShape)
|
||||||
{
|
{
|
||||||
|
m_cursorInfo.hasShape = false;
|
||||||
if (m_cursorInfo.dataSize > m_cursorDataSize)
|
if (m_cursorInfo.dataSize > m_cursorDataSize)
|
||||||
DEBUG_ERROR("Cursor size exceeds allocated space");
|
DEBUG_ERROR("Cursor size exceeds allocated space");
|
||||||
else
|
else
|
||||||
@ -356,8 +377,8 @@ DWORD Service::CursorThread()
|
|||||||
memcpy(m_cursorData, m_cursorInfo.shape, m_cursorInfo.dataSize);
|
memcpy(m_cursorData, m_cursorInfo.shape, m_cursorInfo.dataSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LeaveCriticalSection(&m_cursorCS);
|
|
||||||
|
|
||||||
|
LeaveCriticalSection(&m_cursorCS);
|
||||||
cursor->flags |= KVMFR_CURSOR_FLAG_UPDATE;
|
cursor->flags |= KVMFR_CURSOR_FLAG_UPDATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user