st/nine: Don't call SetCursor until a cursor is set

The previous code was ignoring the input
until a cursor is set inside d3d
(with SetCursorProperties), as expected
by wine tests.

However it did still make a call to ID3DPresent_SetCursor,
which would result into a SetCursor(NULL) call, thus
hidding any cursor set outside d3d, which we shouldn't do.

Add comment about not avoiding redundant ID3DPresent_SetCursor
calls once a cursor has been set in d3d, as it has been tested to
cause regressions.

Fixes: https://github.com/iXit/Mesa-3D/issues/197

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
Axel Davy 2018-09-15 21:53:25 +02:00
parent dcfde02bb0
commit 0eeb583650
1 changed files with 8 additions and 1 deletions

View File

@ -810,7 +810,14 @@ NineDevice9_ShowCursor( struct NineDevice9 *This,
DBG("This=%p bShow=%d\n", This, (int) bShow);
This->cursor.visible = bShow && (This->cursor.hotspot.x != -1);
/* No-op until a cursor is set in d3d */
if (This->cursor.hotspot.x == -1)
return old;
This->cursor.visible = bShow;
/* Note: Don't optimize by avoiding the call if This->cursor.visible
* hasn't changed. One has to keep in mind the app may do SetCursor
* calls outside d3d, thus such an optimization affects behaviour. */
if (!This->cursor.software)
This->cursor.software = ID3DPresent_SetCursor(This->swapchains[0]->present, NULL, NULL, bShow) != D3D_OK;