Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/user32/message.c | 17 ++++++++--------- server/protocol.def | 3 +-- server/queue.c | 36 +++++++++++++++--------------------- 3 files changed, 24 insertions(+), 32 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index c5c7db667cf..53e0b6495ba 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -2271,12 +2271,11 @@ static void send_parent_notify( HWND hwnd, WORD event, WORD idChild, POINT pt ) * Tell the server we have passed the message to the app * (even though we may end up dropping it later on) */ -static void accept_hardware_message( UINT hw_id, BOOL remove ) +static void accept_hardware_message( UINT hw_id ) { SERVER_START_REQ( accept_hardware_message ) { - req->hw_id = hw_id; - req->remove = remove; + req->hw_id = hw_id; if (wine_server_call( req )) FIXME("Failed to reply to MSG_HARDWARE message. Message may not be removed from queue.\n"); } @@ -2363,10 +2362,10 @@ static BOOL process_keyboard_message( MSG *msg, UINT hw_id, HWND hwnd_filter, { /* skip this message */ HOOK_CallHooks( WH_CBT, HCBT_KEYSKIPPED, LOWORD(msg->wParam), msg->lParam, TRUE ); - accept_hardware_message( hw_id, TRUE ); + accept_hardware_message( hw_id ); return FALSE; } - accept_hardware_message( hw_id, remove ); + if (remove) accept_hardware_message( hw_id ); msg->pt = point_phys_to_win_dpi( msg->hwnd, msg->pt );
if ( remove && msg->message == WM_KEYDOWN ) @@ -2421,7 +2420,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
if (!msg->hwnd || !WIN_IsCurrentThread( msg->hwnd )) { - accept_hardware_message( hw_id, TRUE ); + accept_hardware_message( hw_id ); return FALSE; }
@@ -2517,7 +2516,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H hook.s.dwExtraInfo = extra_info; hook.mouseData = msg->wParam; HOOK_CallHooks( WH_CBT, HCBT_CLICKSKIPPED, message, (LPARAM)&hook, TRUE ); - accept_hardware_message( hw_id, TRUE ); + accept_hardware_message( hw_id ); return FALSE; }
@@ -2525,11 +2524,11 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H { SendMessageW( msg->hwnd, WM_SETCURSOR, (WPARAM)msg->hwnd, MAKELONG( hittest, msg->message )); - accept_hardware_message( hw_id, TRUE ); + accept_hardware_message( hw_id ); return FALSE; }
- accept_hardware_message( hw_id, remove ); + if (remove) accept_hardware_message( hw_id );
if (!remove || info.hwndCapture) { diff --git a/server/protocol.def b/server/protocol.def index 5fe4a2d34c9..35c317b79cc 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2377,10 +2377,9 @@ enum message_type @END
-/* Accept the current hardware message */ +/* Accept and remove the current hardware message */ @REQ(accept_hardware_message) unsigned int hw_id; /* id of the hardware message */ - int remove; /* should we remove the message? */ @END
diff --git a/server/queue.c b/server/queue.c index 5ed8c54c141..5fdbfa56546 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1404,11 +1404,11 @@ static void update_desktop_mouse_state( struct desktop *desktop, unsigned int fl }
/* release the hardware message currently being processed by the given thread */ -static void release_hardware_message( struct msg_queue *queue, unsigned int hw_id, - int remove ) +static void release_hardware_message( struct msg_queue *queue, unsigned int hw_id ) { struct thread_input *input = queue->input; - struct message *msg; + struct message *msg, *other; + int clr_bit;
LIST_FOR_EACH_ENTRY( msg, &input->msg_list, struct message, entry ) { @@ -1417,26 +1417,20 @@ static void release_hardware_message( struct msg_queue *queue, unsigned int hw_i if (&msg->entry == &input->msg_list) return; /* not found */
/* clear the queue bit for that message */ - if (remove) + clr_bit = get_hardware_msg_bit( msg ); + LIST_FOR_EACH_ENTRY( other, &input->msg_list, struct message, entry ) { - struct message *other; - int clr_bit; - - clr_bit = get_hardware_msg_bit( msg ); - LIST_FOR_EACH_ENTRY( other, &input->msg_list, struct message, entry ) + if (other != msg && get_hardware_msg_bit( other ) == clr_bit) { - if (other != msg && get_hardware_msg_bit( other ) == clr_bit) - { - clr_bit = 0; - break; - } + clr_bit = 0; + break; } - if (clr_bit) clear_queue_bits( queue, clr_bit ); - - update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); - list_remove( &msg->entry ); - free_message( msg ); } + if (clr_bit) clear_queue_bits( queue, clr_bit ); + + update_input_key_state( input->desktop, input->keystate, msg->msg, msg->wparam ); + list_remove( &msg->entry ); + free_message( msg ); }
static int queue_hotkey_message( struct desktop *desktop, struct message *msg ) @@ -2099,7 +2093,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user data->hw_id = msg->unique_id; set_reply_data( msg->data, msg->data_size ); if (msg->msg == WM_INPUT && (flags & PM_REMOVE)) - release_hardware_message( current->queue, data->hw_id, 1 ); + release_hardware_message( current->queue, data->hw_id ); return 1; } /* nothing found, clear the hardware queue bits */ @@ -2625,7 +2619,7 @@ DECL_HANDLER(reply_message) DECL_HANDLER(accept_hardware_message) { if (current->queue) - release_hardware_message( current->queue, req->hw_id, req->remove ); + release_hardware_message( current->queue, req->hw_id ); else set_error( STATUS_ACCESS_DENIED ); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=74939
Your paranoid android.
=== debiant (32 bit report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout sysparams: Timeout text: Timeout uitools: Timeout win: Timeout
=== debiant (32 bit Chinese:China report) ===
user32: input.c:2485: Test failed: 4: Unexpected cursor movement input.c:2485: Test failed: 5: Unexpected cursor movement input.c:2485: Test failed: 6: Unexpected cursor movement input.c:2485: Test failed: 7: Unexpected cursor movement input.c:2485: Test failed: 8: Unexpected cursor movement input.c:2206: Test failed: 9: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 9: Unexpected cursor movement input.c:2206: Test failed: 10: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 10: Unexpected cursor movement input.c:2206: Test failed: 11: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 11: Unexpected cursor movement input.c:2206: Test failed: 12: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 12: Unexpected cursor movement input.c:2485: Test failed: 13: Unexpected cursor movement input.c:2485: Test failed: 14: Unexpected cursor movement input.c:2485: Test failed: 15: Unexpected cursor movement input.c:2485: Test failed: 16: Unexpected cursor movement
=== debiant (32 bit WoW report) ===
user32: monitor: Timeout msg: Timeout resource: Timeout scroll: Timeout static: Timeout sysparams: Timeout text: Timeout uitools: Timeout win: Timeout
=== debiant (64 bit WoW report) ===
user32: input.c:2485: Test failed: 4: Unexpected cursor movement input.c:2485: Test failed: 5: Unexpected cursor movement input.c:2485: Test failed: 6: Unexpected cursor movement input.c:2485: Test failed: 7: Unexpected cursor movement input.c:2485: Test failed: 8: Unexpected cursor movement input.c:2206: Test failed: 9: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 9: Unexpected cursor movement input.c:2206: Test failed: 10: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 10: Unexpected cursor movement input.c:2206: Test failed: 11: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 11: Unexpected cursor movement input.c:2206: Test failed: 12: foreground process expected WM_MOUSEMOVE message input.c:2485: Test failed: 12: Unexpected cursor movement input.c:2485: Test failed: 13: Unexpected cursor movement input.c:2485: Test failed: 14: Unexpected cursor movement input.c:2485: Test failed: 15: Unexpected cursor movement input.c:2485: Test failed: 16: Unexpected cursor movement