user32: Support the MOUSEEVENTF_VIRTUALDESK flag in SendInput().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-08-27 14:17:19 +02:00
parent 8bca1b29cd
commit ac3e887e5d
1 changed files with 11 additions and 2 deletions

View File

@ -141,8 +141,17 @@ static void update_mouse_coords( INPUT *input )
if (input->u.mi.dwFlags & MOUSEEVENTF_ABSOLUTE)
{
input->u.mi.dx = (input->u.mi.dx * GetSystemMetrics( SM_CXSCREEN )) >> 16;
input->u.mi.dy = (input->u.mi.dy * GetSystemMetrics( SM_CYSCREEN )) >> 16;
if (input->u.mi.dwFlags & MOUSEEVENTF_VIRTUALDESK)
{
RECT rc = get_virtual_screen_rect();
input->u.mi.dx = rc.left + ((input->u.mi.dx * (rc.right - rc.left)) >> 16);
input->u.mi.dy = rc.top + ((input->u.mi.dy * (rc.bottom - rc.top)) >> 16);
}
else
{
input->u.mi.dx = (input->u.mi.dx * GetSystemMetrics( SM_CXSCREEN )) >> 16;
input->u.mi.dy = (input->u.mi.dy * GetSystemMetrics( SM_CYSCREEN )) >> 16;
}
}
else
{