From 7eaed40b379c33c7863940c90aca4e6350024a36 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 27 Nov 2015 14:20:58 +0200 Subject: [PATCH] compositor-drm: fix hw cursor positioning Fix a regression introduced by be428b3825043cbcc676d2526fe6213bea7f676a which accidentally removed the global-to-output space conversion. Signed-off-by: Pekka Paalanen Cc: Derek Foreman Cc: Daniel Stone Reviewed-by: Derek Foreman Tested-by: Derek Foreman --- src/compositor-drm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 65758474..4f9bbaff 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1196,6 +1196,13 @@ drm_output_set_cursor(struct drm_output *output) } weston_view_to_global_float(ev, 0, 0, &x, &y); + + /* From global to output space, output transform is guaranteed to be + * NORMAL by drm_output_prepare_cursor_view(). + */ + x = (x - output->base.x) * output->base.current_scale; + y = (y - output->base.y) * output->base.current_scale; + if (output->cursor_plane.x != x || output->cursor_plane.y != y) { if (drmModeMoveCursor(b->drm.fd, output->crtc_id, x, y)) { weston_log("failed to move cursor: %m\n");