server: Generate WM_POINTERENTER / WM_POINTERLEAVE messages.

This commit is contained in:
Rémi Bernon 2024-02-15 12:26:54 +01:00 committed by Alexandre Julliard
parent 5b833c83be
commit d8b8ac85eb
2 changed files with 24 additions and 34 deletions

View file

@ -2004,7 +2004,6 @@ static void test_hid_touch_screen(void)
res = msg_wait_for_events( 1, &touchleave_event, 500 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
todo_wine
ok( pointer_enter_count == 1, "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 );
@ -2012,13 +2011,10 @@ static void test_hid_touch_screen(void)
expect_flags = POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_CONFIDENCE |
POINTER_MESSAGE_FLAG_FIRSTBUTTON | POINTER_MESSAGE_FLAG_NEW |
POINTER_MESSAGE_FLAG_INRANGE | POINTER_MESSAGE_FLAG_INCONTACT;
todo_wine
todo_wine /* missing POINTER_MESSAGE_FLAG_FIRSTBUTTON */
ok( HIWORD( pointer_wparam[0] ) == expect_flags, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
ok( LOWORD( pointer_wparam[0] ) > 0, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
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] );
id = LOWORD( pointer_wparam[0] );
@ -2027,6 +2023,7 @@ static void test_hid_touch_screen(void)
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, "got wparam %#Ix\n", pointer_wparam[1] );
todo_wine
ok( LOWORD( pointer_lparam[1] ) * 128 / width == 0x08, "got lparam %#Ix\n", pointer_lparam[1] );
@ -2141,20 +2138,16 @@ static void test_hid_touch_screen(void)
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 );
todo_wine
ok( pointer_enter_count == 1, "got pointer_enter_count %u\n", pointer_enter_count );
ok( pointer_up_count == 0, "got pointer_up_count %u\n", pointer_up_count );
expect_flags = POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_CONFIDENCE |
POINTER_MESSAGE_FLAG_FIRSTBUTTON | POINTER_MESSAGE_FLAG_NEW |
POINTER_MESSAGE_FLAG_INRANGE | POINTER_MESSAGE_FLAG_INCONTACT;
todo_wine
todo_wine /* missing POINTER_MESSAGE_FLAG_FIRSTBUTTON */
ok( HIWORD( pointer_wparam[0] ) == expect_flags, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
ok( LOWORD( pointer_wparam[0] ) > 0, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
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] );
@ -2167,7 +2160,6 @@ static void test_hid_touch_screen(void)
bus_send_hid_input( file, &desc, &touch_release, sizeof(touch_release) );
res = msg_wait_for_events( 1, &touchleave_event, 1000 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchdown_event, 10 );
ok( res == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx\n", res );
@ -2178,7 +2170,6 @@ static void test_hid_touch_screen(void)
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] );
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] );
ok( HIWORD( pointer_lparam[0] ) * 128 / height == 0x10, "got lparam %#Ix\n", pointer_lparam[0] );
@ -2197,34 +2188,27 @@ static void test_hid_touch_screen(void)
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 );
todo_wine
ok( pointer_enter_count == 2, "got pointer_enter_count %u\n", pointer_enter_count );
ok( pointer_up_count == 0, "got pointer_up_count %u\n", pointer_up_count );
expect_flags = POINTER_MESSAGE_FLAG_PRIMARY | POINTER_MESSAGE_FLAG_CONFIDENCE |
POINTER_MESSAGE_FLAG_FIRSTBUTTON | POINTER_MESSAGE_FLAG_NEW |
POINTER_MESSAGE_FLAG_INRANGE | POINTER_MESSAGE_FLAG_INCONTACT;
todo_wine
todo_wine /* missing POINTER_MESSAGE_FLAG_FIRSTBUTTON */
ok( HIWORD( pointer_wparam[0] ) == expect_flags, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
ok( LOWORD( pointer_wparam[0] ) > 0, "got wparam %#Ix\n", pointer_wparam[0] );
todo_wine
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] );
id = LOWORD( pointer_wparam[0] );
expect_flags = POINTER_MESSAGE_FLAG_CONFIDENCE | POINTER_MESSAGE_FLAG_FIRSTBUTTON |
POINTER_MESSAGE_FLAG_NEW | POINTER_MESSAGE_FLAG_INRANGE | POINTER_MESSAGE_FLAG_INCONTACT;
todo_wine
todo_wine /* missing POINTER_MESSAGE_FLAG_FIRSTBUTTON */
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] );
@ -2234,10 +2218,8 @@ static void test_hid_touch_screen(void)
bus_send_hid_input( file, &desc, &touch_release, sizeof(touch_release) );
res = msg_wait_for_events( 1, &touchleave_event, 1000 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchleave_event, 1000 );
todo_wine
ok( res == 0, "WaitForSingleObject returned %#lx\n", res );
res = msg_wait_for_events( 1, &touchdown_event, 10 );
ok( res == WAIT_TIMEOUT, "WaitForSingleObject returned %#lx\n", res );
@ -2248,7 +2230,6 @@ static void test_hid_touch_screen(void)
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] );
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] );
ok( HIWORD( pointer_lparam[0] ) * 128 / height == 0x10, "got lparam %#Ix\n", pointer_lparam[0] );
@ -2257,7 +2238,6 @@ static void test_hid_touch_screen(void)
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] );
ok( LOWORD( pointer_lparam[1] ) * 128 / width == 0x18, "got lparam %#Ix\n", pointer_lparam[1] );
ok( HIWORD( pointer_lparam[1] ) * 128 / height == 0x20, "got lparam %#Ix\n", pointer_lparam[1] );

View file

@ -2229,10 +2229,17 @@ struct pointer
static void queue_pointer_message( struct pointer *pointer )
{
static const unsigned int messages[][2] =
{
{WM_POINTERUPDATE, 0},
{WM_POINTERENTER, WM_POINTERDOWN},
{WM_POINTERUP, WM_POINTERLEAVE},
};
struct hw_msg_source source = { IMDT_UNAVAILABLE, IMDT_TOUCH };
struct desktop *desktop = pointer->desktop;
const hw_input_t *input = &pointer->input;
unsigned int wparam = input->hw.wparam;
unsigned int i, wparam = input->hw.wparam;
timeout_t time = get_tick_count();
user_handle_t win = pointer->win;
rectangle_t top_rect;
struct message *msg;
@ -2244,16 +2251,19 @@ static void queue_pointer_message( struct pointer *pointer )
if (pointer->primary) wparam |= POINTER_MESSAGE_FLAG_PRIMARY << 16;
if (!(msg = alloc_hardware_message( 0, source, get_tick_count(), 0 ))) return;
for (i = 0; i < 2 && messages[input->hw.msg - WM_POINTERUPDATE][i]; i++)
{
if (!(msg = alloc_hardware_message( 0, source, time, 0 ))) return;
msg->win = get_user_full_handle( win );
msg->msg = input->hw.msg;
msg->wparam = wparam;
msg->lparam = MAKELONG(x, y);
msg->x = desktop->cursor.x;
msg->y = desktop->cursor.y;
msg->win = get_user_full_handle( win );
msg->msg = messages[input->hw.msg - WM_POINTERUPDATE][i];
msg->wparam = wparam;
msg->lparam = MAKELONG(x, y);
msg->x = desktop->cursor.x;
msg->y = desktop->cursor.y;
queue_hardware_message( desktop, msg, 1 );
queue_hardware_message( desktop, msg, 1 );
}
if (input->hw.msg == WM_POINTERUP)
{