WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] ioemu: Let the USB tablet reach the far bottom and r

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] ioemu: Let the USB tablet reach the far bottom and right pixels
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Wed, 5 Mar 2008 10:58:00 +0000
Delivery-date: Wed, 05 Mar 2008 02:59:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
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@xxxxxxxxxxxxx>

diff -r 854b0704962b tools/ioemu/hw/xenfb.c
--- a/tools/ioemu/hw/xenfb.c    Wed Mar 05 09:43:03 2008 +0000
+++ b/tools/ioemu/hw/xenfb.c    Wed Mar 05 10:56:17 2008 +0000
@@ -1052,8 +1052,8 @@ static void xenfb_mouse_event(void *opaq
     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);
@@ -1312,8 +1312,8 @@ static void xenfb_kbd_handler(void *opaq
                         buttons &= ~button;
                     if (kbd_mouse_is_absolute())
                         kbd_mouse_event(
-                                x * 0x7FFF / s->width,
-                                y * 0x7FFF / s->height,
+                                x * 0x7FFF / (s->width - 1),
+                                y * 0x7FFF / (s->height - 1),
                                 0,
                                 buttons);
                     else
diff -r 854b0704962b tools/ioemu/sdl.c
--- a/tools/ioemu/sdl.c Wed Mar 05 09:43:03 2008 +0000
+++ b/tools/ioemu/sdl.c Wed Mar 05 10:56:17 2008 +0000
@@ -331,8 +331,8 @@ static void sdl_send_mouse_event(int dx,
        }
 
        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;
diff -r 854b0704962b tools/ioemu/vnc.c
--- a/tools/ioemu/vnc.c Wed Mar 05 09:43:03 2008 +0000
+++ b/tools/ioemu/vnc.c Wed Mar 05 10:56:17 2008 +0000
@@ -1214,8 +1214,8 @@ static void pointer_event(VncState *vs, 
        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;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] ioemu: Let the USB tablet reach the far bottom and right pixels, Samuel Thibault <=