[Mesa-dev] [PATCH 10/22] st/nine: Init cursor position at device creation

Axel Davy davyaxel0 at gmail.com
Sun Sep 23 17:00:15 UTC 2018


This is only useful for software cursor,
but at least now we won't start it at (0, 0).

Signed-off-by: Axel Davy <davyaxel0 at gmail.com>
---
 src/gallium/state_trackers/nine/device9.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 9bb97bdf9c3..113ba9d975d 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -333,8 +333,11 @@ NineDevice9_ctor( struct NineDevice9 *This,
     This->cursor.hotspot.y = -1;
     This->cursor.w = This->cursor.h = 0;
     This->cursor.visible = FALSE;
-    This->cursor.pos.x = 0;
-    This->cursor.pos.y = 0;
+    if (ID3DPresent_GetCursorPos(This->swapchains[0]->present, &This->cursor.pos) != S_OK) {
+        This->cursor.pos.x = 0;
+        This->cursor.pos.y = 0;
+    }
+
     {
         struct pipe_resource tmpl;
         memset(&tmpl, 0, sizeof(tmpl));
-- 
2.18.0



More information about the mesa-dev mailing list