From: Michel Dänzer <[email protected]>

xf86CursorScreenRec::HotX/Y contain 0 for PRIME slave screens.

Fixes intermittent incorrect HW cursor position on PRIME slave screens
when switching between cursors with different hotspot positions.

Also hoist the hotspot translation out from xf86ScreenSetCursor to
xf86SetCursor, since the hotspot position is a property of the cursor,
not the screen.

Signed-off-by: Michel Dänzer <[email protected]>
---
 hw/xfree86/ramdac/xf86HWCurs.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index 8feb767..ddfd7c4 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -179,8 +179,8 @@ xf86ScreenSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int 
x, int y)
     bits =
         dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen);
 
-    x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
-    y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+    x -= infoPtr->pScrn->frameX0;
+    y -= infoPtr->pScrn->frameY0;
 
     if (!pCurs->bits->argb || !xf86DriverHasLoadCursorARGB(infoPtr))
         if (!bits) {
@@ -213,6 +213,9 @@ xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, 
int y)
 {
     ScreenPtr pSlave;
 
+    x -= pCurs->bits->xhot;
+    y -= pCurs->bits->yhot;
+
     if (!xf86ScreenSetCursor(pScreen, pCurs, x, y))
         return FALSE;
 
-- 
2.9.3

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to