From e75b4dbe72bed29e214fd10d2c8ae135d8f15d20 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 10 Jan 2012 10:28:04 +0100 Subject: vdagentd-uinput: Correct interpretation of coordinates send by the client Coordinates send by the client go from 0 - (width - 1) rather then from 0 - width. Signed-off-by: Hans de Goede --- src/vdagentd-uinput.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vdagentd-uinput.c b/src/vdagentd-uinput.c index 6cfe1c2..8c19e1f 100644 --- a/src/vdagentd-uinput.c +++ b/src/vdagentd-uinput.c @@ -92,8 +92,8 @@ void vdagentd_uinput_update_size(struct vdagentd_uinput **uinputp, .absmax [ ABS_X ] = 32767, .absmax [ ABS_Y ] = 32767, #else - .absmax [ ABS_X ] = width, - .absmax [ ABS_Y ] = height, + .absmax [ ABS_X ] = width - 1, + .absmax [ ABS_Y ] = height - 1, #endif }; int rc; @@ -201,8 +201,8 @@ void vdagentd_uinput_do_mouse(struct vdagentd_uinput **uinputp, mouse->x += uinput->screen_info[mouse->display_id].x; mouse->y += uinput->screen_info[mouse->display_id].y; #ifdef WITH_STATIC_UINPUT - mouse->x = mouse->x * 32767 / uinput->width; - mouse->y = mouse->y * 32767 / uinput->height; + mouse->x = mouse->x * 32767 / (uinput->width - 1); + mouse->y = mouse->y * 32767 / (uinput->height - 1); #endif } -- cgit v1.2.3