Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Operating System: ReactOS
Platform: VirtualBOX
Description
My computer is ASUS i7 notebook pc, I test the newest trunk version on qemu and vbox, qemu seems to work well, but vbox, the mouse can't work. I find the reason is that ros can't get mouse position correct, on the file reactos\reactos\win32ss\user\ntuser\mouse.c, line 189/190 show me ptCursor.x/ptCursor.y is too big to fit the desktop size.
It seems reactos\reactos\lib\drivers\hidparser\api.c has a mistake, line 637/638,
Parser->Copy(&Data, &ReportDescriptor[ReportItem->ByteOffset +1], min(sizeof(ULONG), ReportDescriptorLength - (ReportItem->ByteOffset + 1)));
Data = ReportDescriptor[ReportItem->ByteOffset + 1];
the second line seems redundancy and mistake, I delete the second line, but it still not work.
Just for test, I change file reactos\reactos\win32ss\user\ntuser\mouse.c, line 183-204,
if (pmi->dwFlags & MOUSEEVENTF_MOVE)
{
/* Mouse has changes position */
if (!(pmi->dwFlags & MOUSEEVENTF_ABSOLUTE))
else if (pmi->dwFlags & MOUSEEVENTF_VIRTUALDESK)
{ /* Absolute move in virtual screen units */ ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXVIRTUALSCREEN) >> 16; ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYVIRTUALSCREEN) >> 16; }else
{ /* Absolute move in primary monitor units */ ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXSCREEN) >> 16; ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYSCREEN) >> 16; }}
to
ptCursor.x = pmi->dx * UserGetSystemMetrics(SM_CXVIRTUALSCREEN) >> 15;
ptCursor.y = pmi->dy * UserGetSystemMetrics(SM_CYVIRTUALSCREEN) >> 15;
this time the mouse pointer shows and goes correctly, the mouse position gets and shows right.