Commit c9ffab46 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

win32u: Add support for sending and receiving WM_POINTER* messages.

parent 61d1c189
......@@ -2000,7 +2000,6 @@ static void test_hid_touch_screen(void)
ok( !res, "MsgWaitForMultipleObjects returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchdown_event, 10 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchleave_event, 500 );
todo_wine
......@@ -2139,7 +2138,6 @@ static void test_hid_touch_screen(void)
bus_send_hid_input( file, &desc, &touch_single, sizeof(touch_single) );
res = msg_wait_for_events( 1, &touchdown_event, 1000 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchleave_event, 10 );
ok( res == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx\n", res );
......@@ -2174,18 +2172,15 @@ static void test_hid_touch_screen(void)
res = msg_wait_for_events( 1, &touchdown_event, 10 );
ok( res == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx\n", res );
ok( pointer_enter_count == 0, "got pointer_enter_count %u\n", pointer_enter_count );
todo_wine
ok( pointer_up_count == 1, "got pointer_up_count %u\n", pointer_up_count );
expect_flags = POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_CONFIDENCE;
todo_wine
ok( HIWORD( pointer_wparam[0] ) == expect_flags ||
broken(HIWORD( pointer_wparam[0] ) == (expect_flags & ~POINTER_MESSAGE_FLAG_CONFIDENCE)), /* Win8 32bit */
"got wparam %#Ix\n", pointer_wparam[0] );
ok( LOWORD( pointer_wparam[0] ) == id, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
ok( LOWORD( pointer_wparam[0] ) == id, "got wparam %#Ix\n", pointer_wparam[0] );
ok( LOWORD( pointer_lparam[0] ) * 128 / width == 0x08, "got lparam %#Ix\n", pointer_lparam[0] );
todo_wine
ok( HIWORD( pointer_lparam[0] ) * 128 / height == 0x10, "got lparam %#Ix\n", pointer_lparam[0] );
ok( pointer_wparam[1] == 0, "got wparam %#Ix\n", pointer_wparam[1] );
ok( pointer_lparam[1] == 0, "got lparam %#Ix\n", pointer_lparam[1] );
......@@ -2197,10 +2192,8 @@ static void test_hid_touch_screen(void)
bus_send_hid_input( file, &desc, &touch_multiple, sizeof(touch_multiple) );
res = msg_wait_for_events( 1, &touchdown_event, 1000 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchdown_event, 1000 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchleave_event, 10 );
ok( res == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx\n", res );
......@@ -2249,30 +2242,24 @@ static void test_hid_touch_screen(void)
res = msg_wait_for_events( 1, &touchdown_event, 10 );
ok( res == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx\n", res );
ok( pointer_enter_count == 0, "got pointer_enter_count %u\n", pointer_enter_count );
todo_wine
ok( pointer_up_count == 2, "got pointer_up_count %u\n", pointer_up_count );
expect_flags = POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_CONFIDENCE;
todo_wine
ok( HIWORD( pointer_wparam[0] ) == expect_flags ||
broken(HIWORD( pointer_wparam[0] ) == (expect_flags & ~POINTER_MESSAGE_FLAG_CONFIDENCE)), /* Win8 32bit */
"got wparam %#Ix\n", pointer_wparam[0] );
ok( LOWORD( pointer_wparam[0] ) == id, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
ok( LOWORD( pointer_wparam[0] ) == id, "got wparam %#Ix\n", pointer_wparam[0] );
ok( LOWORD( pointer_lparam[0] ) * 128 / width == 0x08, "got lparam %#Ix\n", pointer_lparam[0] );
todo_wine
ok( HIWORD( pointer_lparam[0] ) * 128 / height == 0x10, "got lparam %#Ix\n", pointer_lparam[0] );
expect_flags = POINTER_MESSAGE_FLAG_CONFIDENCE;
todo_wine
ok( HIWORD( pointer_wparam[1] ) == expect_flags ||
broken(HIWORD( pointer_wparam[1] ) == (expect_flags & ~POINTER_MESSAGE_FLAG_CONFIDENCE)), /* Win8 32bit */
"got wparam %#Ix\n", pointer_wparam[1] );
todo_wine
ok( LOWORD( pointer_wparam[1] ) == id + 1, "got wparam %#Ix\n", pointer_wparam[1] );
todo_wine
ok( LOWORD( pointer_lparam[1] ) * 128 / width == 0x18, "got lparam %#Ix\n", pointer_lparam[1] );
todo_wine
ok( HIWORD( pointer_lparam[1] ) * 128 / height == 0x20, "got lparam %#Ix\n", pointer_lparam[1] );
......
......@@ -2319,6 +2319,16 @@ static void handle_keyboard_repeat_message( HWND hwnd )
NtUserPostMessage( hwnd, msg->message, msg->wParam, msg->lParam );
}
/***********************************************************************
* process_pointer_message
*
* returns TRUE if the contents of 'msg' should be passed to the application
*/
static BOOL process_pointer_message( MSG *msg, UINT hw_id, const struct hardware_msg_data *msg_data )
{
msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt );
return TRUE;
}
/***********************************************************************
* process_keyboard_message
......@@ -2669,6 +2679,8 @@ static BOOL process_hardware_message( MSG *msg, UINT hw_id, const struct hardwar
ret = process_keyboard_message( msg, hw_id, hwnd_filter, first, last, remove );
else if (is_mouse_message( msg->message ))
ret = process_mouse_message( msg, hw_id, msg_data->info, hwnd_filter, first, last, remove );
else if (msg->message >= WM_POINTERUPDATE && msg->message <= WM_POINTERLEAVE)
ret = process_pointer_message( msg, hw_id, msg_data );
else if (msg->message == WM_WINE_CLIPCURSOR)
process_wine_clipcursor( msg->hwnd, msg->wParam, msg->lParam );
else if (msg->message == WM_WINE_SETCURSOR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment