From 3a65c61aab0ea7de9bd6c8c3f2b3d29d3ecf8e90 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 22 Oct 2025 11:58:27 +1100 Subject: [PATCH] Rebase against ff5b9971b3a1794043ecc75e639e91a8776e169b. --- ...ing-of-GetMessage-after-previous-Pee.patch | 46 ++++++++++--------- staging/upstream-commit | 2 +- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch b/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch index 5cee3fd7..7c0ebba8 100644 --- a/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch +++ b/patches/server-PeekMessage/0001-server-Fix-handling-of-GetMessage-after-previous-Pee.patch @@ -1,4 +1,4 @@ -From 8ce710ee30e95c93b36e4d5e9d4bcba8fd6f0493 Mon Sep 17 00:00:00 2001 +From 68b654546c4ed9a7874e6ae8b25d7bb0cd6a1b9b Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 15 Mar 2015 01:05:48 +0100 Subject: [PATCH] server: Fix handling of GetMessage after previous PeekMessage @@ -10,9 +10,9 @@ Changes in v2: Changes in v3: * Fix remaining todo_wine. --- - dlls/user32/tests/msg.c | 32 ++++++++++++++++++-------- - server/queue.c | 51 ++++++++++++++++++++++++++++++++++------- - 2 files changed, 66 insertions(+), 17 deletions(-) + dlls/user32/tests/msg.c | 32 ++++++++++++++++++------- + server/queue.c | 53 ++++++++++++++++++++++++++++++++++------- + 2 files changed, 68 insertions(+), 17 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 8671134f349..219cdd805f2 100644 @@ -93,7 +93,7 @@ index 8671134f349..219cdd805f2 100644 * because both messages are in the same queue. */ diff --git a/server/queue.c b/server/queue.c -index fb9499b5589..6b374797b42 100644 +index 82d5a395957..e13c8e61c04 100644 --- a/server/queue.c +++ b/server/queue.c @@ -138,6 +138,7 @@ struct msg_queue @@ -113,7 +113,7 @@ index fb9499b5589..6b374797b42 100644 list_init( &queue->send_result ); list_init( &queue->callback_result ); list_init( &queue->pending_timers ); -@@ -812,13 +815,21 @@ static inline struct msg_queue *get_current_queue(void) +@@ -815,13 +818,21 @@ static inline struct msg_queue *get_current_queue(void) } /* get a (pseudo-)unique id to tag hardware messages */ @@ -136,7 +136,7 @@ index fb9499b5589..6b374797b42 100644 /* lookup an already queued mouse message that matches the message, window and type */ static struct message *find_mouse_message( struct thread_input *input, const struct message *msg ) { -@@ -1169,7 +1180,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win ) +@@ -1172,7 +1183,7 @@ static int match_window( user_handle_t win, user_handle_t msg_win ) } /* retrieve a posted message */ @@ -145,7 +145,7 @@ index fb9499b5589..6b374797b42 100644 unsigned int first, unsigned int last, unsigned int flags, struct get_message_reply *reply ) { -@@ -1180,6 +1191,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win, +@@ -1183,6 +1194,7 @@ static int get_posted_message( struct msg_queue *queue, user_handle_t win, { if (!match_window( win, msg->win )) continue; if (!check_msg_filter( msg->msg, first, last )) continue; @@ -153,7 +153,7 @@ index fb9499b5589..6b374797b42 100644 goto found; /* found one */ } return 0; -@@ -1799,6 +1811,7 @@ found: +@@ -1791,6 +1803,7 @@ found: msg->msg = WM_HOTKEY; msg->wparam = hotkey->id; msg->lparam = ((hotkey->vkey & 0xffff) << 16) | modifiers; @@ -161,7 +161,7 @@ index fb9499b5589..6b374797b42 100644 free( msg->data ); msg->data = NULL; -@@ -2786,7 +2799,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user +@@ -2773,7 +2786,7 @@ static int get_hardware_message( struct thread *thread, unsigned int hw_id, user } /* now we can return it */ @@ -170,7 +170,7 @@ index fb9499b5589..6b374797b42 100644 reply->type = MSG_HARDWARE; reply->win = win; reply->msg = msg_code; -@@ -2925,6 +2938,7 @@ void send_notify_message( user_handle_t win, unsigned int message, lparam_t wpar +@@ -2913,6 +2926,7 @@ void send_notify_message( user_handle_t win, unsigned int message, lparam_t wpar msg->result = NULL; msg->data = NULL; msg->data_size = 0; @@ -178,7 +178,7 @@ index fb9499b5589..6b374797b42 100644 get_message_defaults( thread->queue, &msg->x, &msg->y, &msg->time ); -@@ -3208,6 +3222,7 @@ DECL_HANDLER(send_message) +@@ -3198,6 +3212,7 @@ DECL_HANDLER(send_message) set_queue_bits( recv_queue, QS_SENDMESSAGE ); break; case MSG_POSTED: @@ -186,7 +186,7 @@ index fb9499b5589..6b374797b42 100644 list_add_tail( &recv_queue->msg_list[POST_MESSAGE], &msg->entry ); set_queue_bits( recv_queue, QS_POSTMESSAGE|QS_ALLPOSTMESSAGE ); if (msg->msg == WM_HOTKEY) -@@ -3348,12 +3363,12 @@ DECL_HANDLER(get_message) +@@ -3338,12 +3353,12 @@ DECL_HANDLER(get_message) /* then check for posted messages */ if ((filter & QS_POSTMESSAGE) && @@ -201,7 +201,7 @@ index fb9499b5589..6b374797b42 100644 return; /* only check for quit messages if not posted messages pending */ -@@ -3364,7 +3379,7 @@ DECL_HANDLER(get_message) +@@ -3354,7 +3369,7 @@ DECL_HANDLER(get_message) if ((filter & QS_INPUT) && filter_contains_hw_range( req->get_first, req->get_last ) && get_hardware_message( current, req->hw_id, get_win, req->get_first, req->get_last, req->flags, reply )) @@ -210,7 +210,7 @@ index fb9499b5589..6b374797b42 100644 /* now check for WM_PAINT */ if ((filter & QS_PAINT) && -@@ -3377,7 +3392,7 @@ DECL_HANDLER(get_message) +@@ -3367,7 +3382,7 @@ DECL_HANDLER(get_message) reply->wparam = 0; reply->lparam = 0; get_message_defaults( queue, &reply->x, &reply->y, &reply->time ); @@ -219,10 +219,10 @@ index fb9499b5589..6b374797b42 100644 } /* now check for timer */ -@@ -3393,9 +3408,19 @@ DECL_HANDLER(get_message) +@@ -3381,9 +3396,21 @@ DECL_HANDLER(get_message) + reply->wparam = timer->id; + reply->lparam = timer->lparam; get_message_defaults( queue, &reply->x, &reply->y, &reply->time ); - if (!(req->flags & PM_NOYIELD) && current->process->idle_event) - set_event( current->process->idle_event ); - return; + goto found_msg; } @@ -237,10 +237,12 @@ index fb9499b5589..6b374797b42 100644 + get_posted_message( queue, 0, get_win, WM_HOTKEY, WM_HOTKEY, req->flags, reply )) + return; + - if (get_win == -1 && current->process->idle_event) set_event( current->process->idle_event ); - ++ if (get_win == -1 && current->process->idle_event) set_event( current->process->idle_event ); ++ SHARED_WRITE_BEGIN( queue_shm, queue_shm_t ) -@@ -3408,6 +3433,13 @@ DECL_HANDLER(get_message) + { + shared->wake_mask = req->wake_mask; +@@ -3394,6 +3421,13 @@ DECL_HANDLER(get_message) if (!get_queue_status( queue )) reset_sync( queue->sync ); else signal_sync( queue->sync ); set_error( STATUS_PENDING ); /* FIXME */ @@ -254,7 +256,7 @@ index fb9499b5589..6b374797b42 100644 } -@@ -3425,7 +3457,10 @@ DECL_HANDLER(reply_message) +@@ -3411,7 +3445,10 @@ DECL_HANDLER(reply_message) DECL_HANDLER(accept_hardware_message) { if (current->queue) diff --git a/staging/upstream-commit b/staging/upstream-commit index 68894461..c1e6884d 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -d62035da4aa91327c6e38a2c8a66b829eb0983ed +ff5b9971b3a1794043ecc75e639e91a8776e169b