Module: wine Branch: master Commit: ff8f6e8662a5f603b1fe1b087989f238bca0c4ab URL: http://source.winehq.org/git/wine.git/?a=commit;h=ff8f6e8662a5f603b1fe1b0879...
Author: Francois Gouget fgouget@codeweavers.com Date: Fri Aug 5 20:29:52 2011 +0200
user32: When destroying a window, preserve the first WM_QUIT message that was posted to it.
---
dlls/user32/tests/msg.c | 2 +- server/queue.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index c7361dc..9aaf149 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -10241,7 +10241,7 @@ static void test_quit_message(void) add_message(&rmsg); DispatchMessage(&msg); } - ok_sequence(WmStopQuitSeq, "WmStopQuitSeq", TRUE); + ok_sequence(WmStopQuitSeq, "WmStopQuitSeq", FALSE); }
static const struct message WmMouseHoverSeq[] = { diff --git a/server/queue.c b/server/queue.c index 03b0e92..3fa546e 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1918,7 +1918,15 @@ void queue_cleanup_window( struct thread *thread, user_handle_t win ) LIST_FOR_EACH_SAFE( ptr, next, &queue->msg_list[i] ) { struct message *msg = LIST_ENTRY( ptr, struct message, entry ); - if (msg->win == win) remove_queue_message( queue, msg, i ); + if (msg->win == win) + { + if (msg->msg == WM_QUIT && !queue->quit_message) + { + queue->quit_message = 1; + queue->exit_code = msg->wparam; + } + remove_queue_message( queue, msg, i ); + } } }