mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[host] use a global hook to obtain cursor move pos
This commit is contained in:
@@ -539,8 +539,6 @@ unsigned int Capture::DXGI::Capture()
|
||||
cursor.w = shapeInfo.Width;
|
||||
cursor.h = shapeInfo.Height;
|
||||
cursor.pitch = shapeInfo.Pitch;
|
||||
m_hotSpot.x = shapeInfo.HotSpot.x;
|
||||
m_hotSpot.y = shapeInfo.HotSpot.y;
|
||||
}
|
||||
|
||||
// if we have a mouse update
|
||||
@@ -556,24 +554,6 @@ unsigned int Capture::DXGI::Capture()
|
||||
cursor.y = m_lastCursorY = frameInfo.PointerPosition.Position.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// always report the mouse position to prevent the guest losing sync (ie: dragging windows)
|
||||
POINT curPos;
|
||||
if (GetCursorPos(&curPos))
|
||||
{
|
||||
curPos.x -= m_hotSpot.x;
|
||||
curPos.y -= m_hotSpot.y;
|
||||
|
||||
if (curPos.x != m_lastCursorX || curPos.y != m_lastCursorY)
|
||||
{
|
||||
ret |= GRAB_STATUS_CURSOR;
|
||||
cursor.hasPos = true;
|
||||
cursor.x = m_lastCursorX = curPos.x;
|
||||
cursor.y = m_lastCursorY = curPos.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_lastMouseVis != frameInfo.PointerPosition.Visible)
|
||||
m_lastMouseVis = frameInfo.PointerPosition.Visible;
|
||||
|
Reference in New Issue
Block a user