diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-01-10 10:28:04 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2012-01-10 13:26:58 +0100 |
commit | e75b4dbe72bed29e214fd10d2c8ae135d8f15d20 (patch) | |
tree | c23b9f84b4b8d9bd839dfc2da2328009ed898973 | |
parent | a1c0042dd602651cbc6ef5d2670f2ad5f46b17f4 (diff) |
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 <hdegoede@redhat.com>
-rw-r--r-- | src/vdagentd-uinput.c | 8 |
1 files 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 } |