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