summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2018-09-15 21:53:25 +0200
committerAxel Davy <[email protected]>2018-09-25 22:05:24 +0200
commit0eeb583650c64e789e0bfa7b3194310c5c44ba4f (patch)
tree8271aa0f42f7f0cfa0a88a9fa07e9092ea268431 /src/gallium/state_trackers
parentdcfde02bb0f0b9fdd8d45a22540683fe0aaab9ec (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/device9.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index b3e56d70b74..04f90ad8210 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -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;