user32: When destroying a window, preserve the first WM_QUIT message that was posted to it.

This commit is contained in:
Francois Gouget 2011-08-05 20:29:52 +02:00 committed by Alexandre Julliard
parent 30f2c6610d
commit ff8f6e8662
2 changed files with 10 additions and 2 deletions

View File

@ -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[] = {

View File

@ -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 );
}
}
}