From 8fd82c88e3f2060fda4ba30376900ece77668c63 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 17 Mar 2008 16:14:43 -0700 Subject: [PATCH] Adjust transformed cursor position to account for hotspot --- hw/xfree86/modes/xf86Cursors.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index a7ed5c4d4..7bf92651f 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -37,6 +37,7 @@ #include "xf86Crtc.h" #include "xf86Modes.h" #include "xf86RandR12.h" +#include "xf86CursorPriv.h" #include "X11/extensions/render.h" #define DPMS_SERVER #include "X11/extensions/dpms.h" @@ -321,10 +322,18 @@ xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) */ if (crtc->transform_in_use) { + ScreenPtr screen = scrn->pScreen; + xf86CursorScreenPtr ScreenPriv = + (xf86CursorScreenPtr)dixLookupPrivate(&screen->devPrivates, + xf86CursorScreenKey); PictVector v; + x += ScreenPriv->HotX; + y += ScreenPriv->HotY; v.vector[0] = IntToxFixed (x); v.vector[1] = IntToxFixed (y); v.vector[2] = IntToxFixed(1); PictureTransformPoint (&crtc->framebuffer_to_crtc, &v); x = xFixedToInt (v.vector[0]); y = xFixedToInt (v.vector[1]); + x -= ScreenPriv->HotX; + y -= ScreenPriv->HotY; } else {