]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
ioemu: Let the USB tablet reach the far bottom and right pixels
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 20 Mar 2008 12:04:51 +0000 (12:04 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 20 Mar 2008 12:04:51 +0000 (12:04 +0000)
by fixing divisions / multiplications into using width-1.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
xen-unstable changeset:   17189:86e64b684fb2751f8d2db7e07e88da8505008255
xen-unstable date:        Wed Mar 05 11:10:29 2008 +0000

tools/ioemu/hw/xenfb.c
tools/ioemu/sdl.c
tools/ioemu/vnc.c

index bd947787ed29f6c7677ed9d18156db5613f276b9..aa646f693f2a7137bc8c30fa33f01c58fc2864d6 100644 (file)
@@ -1044,8 +1044,8 @@ static void xenfb_mouse_event(void *opaque,
     struct xenfb *xenfb = opaque;
     if (xenfb->abs_pointer_wanted)
            xenfb_send_position(xenfb,
-                               dx * xenfb->ds->width / 0x7fff,
-                               dy * xenfb->ds->height / 0x7fff,
+                                dx * (xenfb->ds->width - 1) / 0x7fff,
+                                dy * (xenfb->ds->height - 1) / 0x7fff,
                                dz);
     else
            xenfb_send_motion(xenfb, dx, dy, dz);
index d2af24752b65511b04198cca380ce27442d76d5a..4f12a36027151434744701cd3048a3e21a5e12b5 100644 (file)
@@ -279,8 +279,8 @@ static void sdl_send_mouse_event(int dx, int dy, int dz, int state)
        }
 
        SDL_GetMouseState(&dx, &dy);
-       dx = dx * 0x7FFF / width;
-       dy = dy * 0x7FFF / height;
+        dx = dx * 0x7FFF / (width - 1);
+        dy = dy * 0x7FFF / (height - 1);
     } else if (absolute_enabled) {
        sdl_show_cursor();
        absolute_enabled = 0;
index 11cd94479f0e0c5c08a4192531cf667c555e852e..f2ee9ea47fa4be7db6379d0f7bebe444202685bd 100644 (file)
@@ -1023,8 +1023,8 @@ static void pointer_event(VncState *vs, int button_mask, int x, int y)
        dz = 1;
 
     if (vs->absolute) {
-       kbd_mouse_event(x * 0x7FFF / vs->ds->width,
-                       y * 0x7FFF / vs->ds->height,
+        kbd_mouse_event(x * 0x7FFF / (vs->ds->width - 1),
+                        y * 0x7FFF / (vs->ds->height - 1),
                        dz, buttons);
     } else if (vs->has_pointer_type_change) {
        x -= 0x7FFF;