ia64/xen-unstable

changeset 16578:4054cd60895b

ioemu: Include mouse dz in xenfb event packet

Needed for mouse wheel support in a PV guest.

Signed-off-by: Pat Campbell <plc@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Dec 10 13:49:22 2007 +0000 (2007-12-10)
parents d9cd502d8df2
children 35b2c54f59d5 0884e0a5ecc3
files tools/ioemu/hw/xenfb.c xen/include/public/io/kbdif.h
line diff
     1.1 --- a/tools/ioemu/hw/xenfb.c	Mon Dec 10 12:02:46 2007 +0000
     1.2 +++ b/tools/ioemu/hw/xenfb.c	Mon Dec 10 13:49:22 2007 +0000
     1.3 @@ -592,7 +592,7 @@ static int xenfb_send_key(struct xenfb *
     1.4  }
     1.5  
     1.6  /* Send a relative mouse movement event */
     1.7 -static int xenfb_send_motion(struct xenfb *xenfb, int rel_x, int rel_y)
     1.8 +static int xenfb_send_motion(struct xenfb *xenfb, int rel_x, int rel_y, int rel_z)
     1.9  {
    1.10  	union xenkbd_in_event event;
    1.11  
    1.12 @@ -600,12 +600,13 @@ static int xenfb_send_motion(struct xenf
    1.13  	event.type = XENKBD_TYPE_MOTION;
    1.14  	event.motion.rel_x = rel_x;
    1.15  	event.motion.rel_y = rel_y;
    1.16 +	event.motion.rel_z = rel_z;
    1.17  
    1.18  	return xenfb_kbd_event(xenfb, &event);
    1.19  }
    1.20  
    1.21  /* Send an absolute mouse movement event */
    1.22 -static int xenfb_send_position(struct xenfb *xenfb, int abs_x, int abs_y)
    1.23 +static int xenfb_send_position(struct xenfb *xenfb, int abs_x, int abs_y, int abs_z)
    1.24  {
    1.25  	union xenkbd_in_event event;
    1.26  
    1.27 @@ -613,6 +614,7 @@ static int xenfb_send_position(struct xe
    1.28  	event.type = XENKBD_TYPE_POS;
    1.29  	event.pos.abs_x = abs_x;
    1.30  	event.pos.abs_y = abs_y;
    1.31 +	event.pos.abs_z = abs_z;
    1.32  
    1.33  	return xenfb_kbd_event(xenfb, &event);
    1.34  }
    1.35 @@ -1043,9 +1045,10 @@ static void xenfb_mouse_event(void *opaq
    1.36      if (xenfb->abs_pointer_wanted)
    1.37  	    xenfb_send_position(xenfb,
    1.38  				dx * xenfb->ds->width / 0x7fff,
    1.39 -				dy * xenfb->ds->height / 0x7fff);
    1.40 +				dy * xenfb->ds->height / 0x7fff,
    1.41 +				dz);
    1.42      else
    1.43 -	    xenfb_send_motion(xenfb, dx, dy);
    1.44 +	    xenfb_send_motion(xenfb, dx, dy, dz);
    1.45  
    1.46      for (i = 0 ; i < 8 ; i++) {
    1.47  	    int lastDown = xenfb->button_state & (1 << i);
     2.1 --- a/xen/include/public/io/kbdif.h	Mon Dec 10 12:02:46 2007 +0000
     2.2 +++ b/xen/include/public/io/kbdif.h	Mon Dec 10 13:49:22 2007 +0000
     2.3 @@ -50,6 +50,7 @@ struct xenkbd_motion
     2.4      uint8_t type;        /* XENKBD_TYPE_MOTION */
     2.5      int32_t rel_x;       /* relative X motion */
     2.6      int32_t rel_y;       /* relative Y motion */
     2.7 +    int32_t rel_z;       /* relative Z motion (wheel) */
     2.8  };
     2.9  
    2.10  struct xenkbd_key
    2.11 @@ -64,6 +65,7 @@ struct xenkbd_position
    2.12      uint8_t type;        /* XENKBD_TYPE_POS */
    2.13      int32_t abs_x;       /* absolute X position (in FB pixels) */
    2.14      int32_t abs_y;       /* absolute Y position (in FB pixels) */
    2.15 +    int32_t abs_z;       /* absolute Z position (wheel) */
    2.16  };
    2.17  
    2.18  #define XENKBD_IN_EVENT_SIZE 40