@@ -823,8 +823,9 @@ BOOL PeekMessageEx (PMSG pMsg, HWND hWnd,
823
823
goto got_ret ;
824
824
}
825
825
}
826
- else
826
+ else {
827
827
pMsgQueue -> dwState &= ~QS_POSTMSG ;
828
+ }
828
829
}
829
830
830
831
/*
@@ -1410,6 +1411,9 @@ LRESULT GUIAPI DispatchMessage (PMSG pMsg)
1410
1411
to the controls of the main window will be thrown away as well. */
1411
1412
int __mg_throw_away_messages (PMSGQUEUE pMsgQueue , HWND hWnd )
1412
1413
{
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. */
1413
1417
PMAINWIN pMainWin = (PMAINWIN )hWnd ;
1414
1418
PMSG pMsg ;
1415
1419
PQMSG pQMsg ;
@@ -1421,16 +1425,6 @@ int __mg_throw_away_messages (PMSGQUEUE pMsgQueue, HWND hWnd)
1421
1425
1422
1426
LOCK_MSGQ (pMsgQueue );
1423
1427
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
-
1434
1428
if (pMsgQueue -> pFirstNotifyMsg ) {
1435
1429
PQMSG pPrev = NULL , pNext ;
1436
1430
pQMsg = pMsgQueue -> pFirstNotifyMsg ;
0 commit comments