Commit 685a3e6a authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Release critical section before warping mouse.

parent f57bf100
......@@ -511,12 +511,12 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState(
if(This->base.acquired == 0) return DIERR_NOTACQUIRED;
EnterCriticalSection(&This->base.crit);
TRACE("(this=%p,0x%08x,%p):\n", This, len, ptr);
TRACE("(X: %d - Y: %d - Z: %d L: %02x M: %02x R: %02x)\n",
This->m_state.lX, This->m_state.lY, This->m_state.lZ,
This->m_state.rgbButtons[0], This->m_state.rgbButtons[2], This->m_state.rgbButtons[1]);
EnterCriticalSection(&This->base.crit);
/* Copy the current mouse state */
fill_DataFormat(ptr, &(This->m_state), &This->base.data_format);
......@@ -527,15 +527,13 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState(
This->m_state.lY = 0;
This->m_state.lZ = 0;
}
LeaveCriticalSection(&This->base.crit);
/* Check if we need to do a mouse warping */
if (This->need_warp && (GetCurrentTime() - This->last_warped > 10))
{
if(!dinput_window_check(This))
{
LeaveCriticalSection(&This->base.crit);
return DIERR_GENERIC;
}
TRACE("Warping mouse to %d - %d\n", This->mapped_center.x, This->mapped_center.y);
SetCursorPos( This->mapped_center.x, This->mapped_center.y );
This->last_warped = GetCurrentTime();
......@@ -543,8 +541,6 @@ static HRESULT WINAPI SysMouseAImpl_GetDeviceState(
This->need_warp = FALSE;
}
LeaveCriticalSection(&This->base.crit);
return DI_OK;
}
......
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