Commit 831560cd authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

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().
parent 3a3cd9fa
......@@ -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 );
}
......
......@@ -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;
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) ) ))
{
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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment