fix the bug reported in Issue #89

This commit is contained in:
Vincent Wei
2022-09-21 10:40:22 +08:00
parent 362b852ec2
commit dfc7e95fcd
2 changed files with 7 additions and 11 deletions

View File

@@ -4507,7 +4507,9 @@ int __mg_join_all_message_threads (void)
list_for_each (l, &msg_queue_list) {
MSGQUEUE *msg_queue = (MSGQUEUE*)l;
#ifndef NDEBUG
dump_message_queue (msg_queue, __func__);
#endif
pthread_cancel (msg_queue->th);
}

View File

@@ -823,8 +823,9 @@ checkagain:
goto got_ret;
}
}
else
else {
pMsgQueue->dwState &= ~QS_POSTMSG;
}
}
/*
@@ -1410,6 +1411,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
to the controls of the main window will be thrown away as well. */
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
{
/* For a main window, we use pMainWin to check whether we
should throw away a message for controls of the main window.
Note that checkAndGetMainWindowIfControl returns NULL for non control. */
PMAINWIN pMainWin = (PMAINWIN)hWnd;
PMSG pMsg;
PQMSG pQMsg;
@@ -1421,16 +1425,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
LOCK_MSGQ (pMsgQueue);
/* for virtual window and main window, use pMainWin to check whether we
should throw away a message for controls of a main window.
checkAndGetMainWindowIfControl returns NULL for non control. */
if (pMainWin != HWND_NULL && pMainWin != HWND_INVALID &&
(pMainWin->WinType == TYPE_MAINWIN ||
pMainWin->WinType == TYPE_VIRTWIN))
pMainWin = (PMAINWIN)hWnd;
else
pMainWin = NULL;
if (pMsgQueue->pFirstNotifyMsg) {
PQMSG pPrev = NULL, pNext;
pQMsg = pMsgQueue->pFirstNotifyMsg;