user32: Flush window surfaces in all functions that are used to poll for input.

This commit is contained in:
Alexandre Julliard 2012-10-15 12:20:28 +02:00
parent cfef60a30e
commit d5244c3b24
1 changed files with 12 additions and 6 deletions

View File

@ -353,6 +353,12 @@ HWND WINAPI GetCapture(void)
}
static void check_for_events( UINT flags )
{
if (USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, flags, 0 ) == WAIT_TIMEOUT)
flush_window_surfaces( TRUE );
}
/**********************************************************************
* GetAsyncKeyState (USER32.@)
*
@ -367,6 +373,8 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
if (key < 0 || key >= 256) return 0;
check_for_events( QS_INPUT );
if ((ret = USER_Driver->pGetAsyncKeyState( key )) == -1)
{
if (thread_info->key_state &&
@ -400,7 +408,7 @@ SHORT WINAPI DECLSPEC_HOTPATCH GetAsyncKeyState( INT key )
*/
DWORD WINAPI GetQueueStatus( UINT flags )
{
DWORD ret = 0;
DWORD ret;
if (flags & ~(QS_ALLINPUT | QS_ALLPOSTMESSAGE | QS_SMRESULT))
{
@ -408,8 +416,7 @@ DWORD WINAPI GetQueueStatus( UINT flags )
return 0;
}
/* check for pending X events */
USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, flags, 0 );
check_for_events( flags );
SERVER_START_REQ( get_queue_status )
{
@ -427,10 +434,9 @@ DWORD WINAPI GetQueueStatus( UINT flags )
*/
BOOL WINAPI GetInputState(void)
{
DWORD ret = 0;
DWORD ret;
/* check for pending X events */
USER_Driver->pMsgWaitForMultipleObjectsEx( 0, NULL, 0, QS_INPUT, 0 );
check_for_events( QS_INPUT );
SERVER_START_REQ( get_queue_status )
{