ia64/xen-unstable

changeset 17189:86e64b684fb2

ioemu: Let the USB tablet reach the far bottom and right pixels
by fixing divisions / multiplications into using width-1.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 05 11:10:29 2008 +0000 (2008-03-05)
parents e1898e917373
children f85b379fa943
files tools/ioemu/hw/xenfb.c tools/ioemu/sdl.c tools/ioemu/vnc.c
line diff
     1.1 --- a/tools/ioemu/hw/xenfb.c	Wed Mar 05 10:54:08 2008 +0000
     1.2 +++ b/tools/ioemu/hw/xenfb.c	Wed Mar 05 11:10:29 2008 +0000
     1.3 @@ -1052,8 +1052,8 @@ static void xenfb_mouse_event(void *opaq
     1.4      struct xenfb *xenfb = opaque;
     1.5      if (xenfb->abs_pointer_wanted)
     1.6  	    xenfb_send_position(xenfb,
     1.7 -				dx * xenfb->ds->width / 0x7fff,
     1.8 -				dy * xenfb->ds->height / 0x7fff,
     1.9 +                                dx * (xenfb->ds->width - 1) / 0x7fff,
    1.10 +                                dy * (xenfb->ds->height - 1) / 0x7fff,
    1.11  				dz);
    1.12      else
    1.13  	    xenfb_send_motion(xenfb, dx, dy, dz);
    1.14 @@ -1312,8 +1312,8 @@ static void xenfb_kbd_handler(void *opaq
    1.15                          buttons &= ~button;
    1.16                      if (kbd_mouse_is_absolute())
    1.17                          kbd_mouse_event(
    1.18 -                                x * 0x7FFF / s->width,
    1.19 -                                y * 0x7FFF / s->height,
    1.20 +                                x * 0x7FFF / (s->width - 1),
    1.21 +                                y * 0x7FFF / (s->height - 1),
    1.22                                  0,
    1.23                                  buttons);
    1.24                      else
     2.1 --- a/tools/ioemu/sdl.c	Wed Mar 05 10:54:08 2008 +0000
     2.2 +++ b/tools/ioemu/sdl.c	Wed Mar 05 11:10:29 2008 +0000
     2.3 @@ -331,8 +331,8 @@ static void sdl_send_mouse_event(int dx,
     2.4  	}
     2.5  
     2.6  	SDL_GetMouseState(&dx, &dy);
     2.7 -	dx = dx * 0x7FFF / width;
     2.8 -	dy = dy * 0x7FFF / height;
     2.9 +        dx = dx * 0x7FFF / (width - 1);
    2.10 +        dy = dy * 0x7FFF / (height - 1);
    2.11      } else if (absolute_enabled) {
    2.12  	sdl_show_cursor();
    2.13  	absolute_enabled = 0;
     3.1 --- a/tools/ioemu/vnc.c	Wed Mar 05 10:54:08 2008 +0000
     3.2 +++ b/tools/ioemu/vnc.c	Wed Mar 05 11:10:29 2008 +0000
     3.3 @@ -1217,8 +1217,8 @@ static void pointer_event(VncState *vs, 
     3.4  	dz = 1;
     3.5  
     3.6      if (vs->absolute) {
     3.7 -	kbd_mouse_event(x * 0x7FFF / vs->ds->width,
     3.8 -			y * 0x7FFF / vs->ds->height,
     3.9 +        kbd_mouse_event(x * 0x7FFF / (vs->ds->width - 1),
    3.10 +                        y * 0x7FFF / (vs->ds->height - 1),
    3.11  			dz, buttons);
    3.12      } else if (vs->has_pointer_type_change) {
    3.13  	x -= 0x7FFF;