Skip to content

Commit dfc7e95

Browse files
committed
fix the bug reported in Issue #89
1 parent 362b852 commit dfc7e95

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/kernel/desktop.c

+2
Original file line numberDiff line numberDiff line change
@@ -4507,7 +4507,9 @@ int __mg_join_all_message_threads (void)
45074507

45084508
list_for_each (l, &msg_queue_list) {
45094509
MSGQUEUE *msg_queue = (MSGQUEUE*)l;
4510+
#ifndef NDEBUG
45104511
dump_message_queue (msg_queue, __func__);
4512+
#endif
45114513
pthread_cancel (msg_queue->th);
45124514
}
45134515

src/kernel/message.c

+5-11
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,9 @@ BOOL PeekMessageEx (PMSG pMsg, HWND hWnd,
823823
goto got_ret;
824824
}
825825
}
826-
else
826+
else {
827827
pMsgQueue->dwState &= ~QS_POSTMSG;
828+
}
828829
}
829830

830831
/*
@@ -1410,6 +1411,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
14101411
to the controls of the main window will be thrown away as well. */
14111412
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
14121413
{
1414+
/* For a main window, we use pMainWin to check whether we
1415+
should throw away a message for controls of the main window.
1416+
Note that checkAndGetMainWindowIfControl returns NULL for non control. */
14131417
PMAINWIN pMainWin = (PMAINWIN)hWnd;
14141418
PMSG pMsg;
14151419
PQMSG pQMsg;
@@ -1421,16 +1425,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
14211425

14221426
LOCK_MSGQ (pMsgQueue);
14231427

1424-
/* for virtual window and main window, use pMainWin to check whether we
1425-
should throw away a message for controls of a main window.
1426-
checkAndGetMainWindowIfControl returns NULL for non control. */
1427-
if (pMainWin != HWND_NULL && pMainWin != HWND_INVALID &&
1428-
(pMainWin->WinType == TYPE_MAINWIN ||
1429-
pMainWin->WinType == TYPE_VIRTWIN))
1430-
pMainWin = (PMAINWIN)hWnd;
1431-
else
1432-
pMainWin = NULL;
1433-
14341428
if (pMsgQueue->pFirstNotifyMsg) {
14351429
PQMSG pPrev = NULL, pNext;
14361430
pQMsg = pMsgQueue->pFirstNotifyMsg;

0 commit comments

Comments
 (0)