diff options
author | Keith Packard <keithp@keithp.com> | 2008-03-17 16:14:43 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:38 -0800 |
commit | 8fd82c88e3f2060fda4ba30376900ece77668c63 (patch) | |
tree | b0a83640f4c89e4d898072d42d711431057c28c0 /hw | |
parent | eb222e64128034df8361d5a82d4f4aa1318923ce (diff) |
Adjust transformed cursor position to account for hotspot
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/modes/xf86Cursors.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 { |