Skip to content

Commit

Permalink
d3d9-nine: add proper cursor pos checks for present interface v1.5
Browse files Browse the repository at this point in the history
Prior to v1.5, mesa would check against stale values for HW cursors
which could lead to missing WM_MOUSEMOVE messages.

This compares against proper current values.

Fixes 1 WINE unit test.
  • Loading branch information
dhewg committed Apr 4, 2019
1 parent c7d3b86 commit e095d0b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion d3d9-nine/present.c
Expand Up @@ -32,7 +32,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d9nine);

#define WINE_D3DADAPTER_DRIVER_PRESENT_VERSION_MAJOR 1
#if defined (ID3DPresentGroup_SetVersion)
#define WINE_D3DADAPTER_DRIVER_PRESENT_VERSION_MINOR 4
/* version 1.5 doesn't introduce a new member, but expects
* SetCursorPosition() calls for every position update
*/
#define WINE_D3DADAPTER_DRIVER_PRESENT_VERSION_MINOR 5
#elif defined (ID3DPresent_SetPresentParameters2)
#define WINE_D3DADAPTER_DRIVER_PRESENT_VERSION_MINOR 3
#elif defined (ID3DPresent_ResolutionMismatch)
Expand Down Expand Up @@ -1172,6 +1175,13 @@ static HRESULT WINAPI DRIPresent_SetCursorPos( struct DRIPresent *This, POINT *p
if (!pPoint)
return D3DERR_INVALIDCALL;

if (This->minor >= 5)
{
GetCursorPos(&real_pos);
if (real_pos.x == pPoint->x && real_pos.y == pPoint->y)
return D3D_OK;
}

ok = SetCursorPos(pPoint->x, pPoint->y);
if (!ok)
goto error;
Expand Down

0 comments on commit e095d0b

Please sign in to comment.