Call EVENT_Pending() to flush X11 output queue before blocking in

MsgWaitForMultipleObjects().
Don't call EVENT_WaitNetEvent in MSG_PeekHardwareMsg.
Protect system queue access in hardware_event().
This commit is contained in:
Ulrich Weigand 1999-03-28 13:10:54 +00:00 committed by Alexandre Julliard
parent 3a3cd9fab1
commit 831560cd97
2 changed files with 15 additions and 3 deletions

View File

@ -502,10 +502,12 @@ static BOOL MSG_PeekHardwareMsg( MSG *msg, HWND hwnd, DWORD first, DWORD last,
qmsg = sysMsgQueue->firstMsg;
#if 0
/* If the queue is empty, attempt to fill it */
if (!sysMsgQueue->msgCount && THREAD_IsWin16( THREAD_Current() )
&& EVENT_Pending())
EVENT_WaitNetEvent( FALSE, FALSE );
#endif
for ( kbd_msg = 0; qmsg; qmsg = nextqmsg)
{
@ -1820,6 +1822,8 @@ DWORD WINAPI MsgWaitForMultipleObjects( DWORD nCount, HANDLE *pHandles,
handles[i] = pHandles[i];
handles[nCount] = msgQueue->hEvent;
EVENT_Pending();
ret = WaitForMultipleObjects( nCount+1, handles, fWaitAll, dwMilliseconds );
}

View File

@ -1146,12 +1146,15 @@ void hardware_event( WORD message, WORD wParam, LONG lParam,
int xPos, int yPos, DWORD time, DWORD extraInfo )
{
MSG *msg;
QMSG *qmsg = sysMsgQueue->lastMsg;
QMSG *qmsg;
int mergeMsg = 0;
if (!sysMsgQueue) return;
/* Merge with previous event if possible */
EnterCriticalSection( &sysMsgQueue->cSection );
/* Merge with previous event if possible */
qmsg = sysMsgQueue->lastMsg;
if ((message == WM_MOUSEMOVE) && sysMsgQueue->lastMsg)
{
@ -1173,7 +1176,10 @@ void hardware_event( WORD message, WORD wParam, LONG lParam,
/* Don't merge allocate a new msg in the global heap */
if (!(qmsg = (QMSG *) HeapAlloc( SystemHeap, 0, sizeof(QMSG) ) ))
return;
{
LeaveCriticalSection( &sysMsgQueue->cSection );
return;
}
/* put message at the end of the linked list */
qmsg->nextMsg = 0;
@ -1201,6 +1207,8 @@ void hardware_event( WORD message, WORD wParam, LONG lParam,
msg->pt.y = yPos;
qmsg->extraInfo = extraInfo;
LeaveCriticalSection( &sysMsgQueue->cSection );
QUEUE_WakeSomeone( message );
}