Skip to content

Commit

Permalink
fix the bug reported in Issue #89
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentWei committed Sep 21, 2022
1 parent 362b852 commit dfc7e95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/kernel/desktop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
16 changes: 5 additions & 11 deletions src/kernel/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,9 @@ BOOL PeekMessageEx (PMSG pMsg, HWND hWnd,
goto got_ret;
}
}
else
else {
pMsgQueue->dwState &= ~QS_POSTMSG;
}
}

/*
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit dfc7e95

Please sign in to comment.