mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[host] don't spam the client with mouse updates when nothing has changed
This commit is contained in:
parent
5cfae05cae
commit
4b4aca841c
@ -248,11 +248,25 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
|
||||
// if we have a mouse update
|
||||
if (frameInfo.LastMouseUpdateTime.QuadPart)
|
||||
{
|
||||
cursorUpdate = true;
|
||||
frame.cursor.hasPos = true;
|
||||
frame.cursor.visible = frameInfo.PointerPosition.Visible;
|
||||
frame.cursor.x = frameInfo.PointerPosition.Position.x;
|
||||
frame.cursor.y = frameInfo.PointerPosition.Position.x;
|
||||
if (
|
||||
m_lastMousePos.x != frameInfo.PointerPosition.Position.x ||
|
||||
m_lastMousePos.y != frameInfo.PointerPosition.Position.y
|
||||
) {
|
||||
cursorUpdate = true;
|
||||
frame.cursor.hasPos = true;
|
||||
frame.cursor.x = frameInfo.PointerPosition.Position.x;
|
||||
frame.cursor.y = frameInfo.PointerPosition.Position.y;
|
||||
m_lastMousePos.x = frameInfo.PointerPosition.Position.x;
|
||||
m_lastMousePos.y = frameInfo.PointerPosition.Position.y;
|
||||
}
|
||||
|
||||
if (m_lastMouseVis != frameInfo.PointerPosition.Visible)
|
||||
{
|
||||
cursorUpdate = true;
|
||||
m_lastMouseVis = frameInfo.PointerPosition.Visible;
|
||||
}
|
||||
|
||||
frame.cursor.visible = m_lastMouseVis;
|
||||
}
|
||||
|
||||
// if the pointer shape has changed
|
||||
@ -293,7 +307,7 @@ GrabStatus DXGI::GrabFrame(FrameInfo & frame)
|
||||
frame.cursor.dataSize = m_pointerSize;
|
||||
}
|
||||
|
||||
if (frameInfo.AccumulatedFrames == 1)
|
||||
if (frameInfo.AccumulatedFrames > 0)
|
||||
break;
|
||||
|
||||
m_dup->ReleaseFrame();
|
||||
|
@ -72,5 +72,7 @@ namespace Capture
|
||||
BYTE * m_pointer;
|
||||
UINT m_pointerBufSize;
|
||||
UINT m_pointerSize;
|
||||
BOOL m_lastMouseVis;
|
||||
POINT m_lastMousePos;
|
||||
};
|
||||
};
|
@ -240,6 +240,8 @@ bool Service::Process()
|
||||
// tell the host where the cursor is
|
||||
m_header->flags |= KVMFR_HEADER_FLAG_CURSOR;
|
||||
m_header->cursor.flags |= KVMFR_CURSOR_FLAG_POS;
|
||||
if (frame.cursor.visible)
|
||||
m_header->cursor.flags |= KVMFR_CURSOR_FLAG_VISIBLE;
|
||||
m_header->cursor.x = frame.cursor.x;
|
||||
m_header->cursor.y = frame.cursor.y;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user