Include mouse dz in xenfb event packet
PATCH 1/1 Include mouse dz in xenfb event packet
Attached patch includes dz in the mouse event packet sent to the frontend. Needed for mouse wheel support in a PV guest.
Please apply to xen- unstable.
Signed- off- by: Pat Campbell <[email protected]>
tools/ioemu/hw/xenfb.c +7 -4
@@ -592,7 +592,7 @@ static int xenfb_send_key(struct xenfb * }/* Send a relative mouse movement event */ -static int xenfb_send_motion (struct xenfb *xenfb,int rel_x,int rel_y) +static int xenfb_send_motion (struct xenfb *xenfb,int rel_x,int rel_y,int rel_z) {union xenkbd_in_event event;
@@ -600,12 +600,13 @@ static int xenfb_send_motion(struct xenf event.type =XENKBD_TYPE_MOTION ; event.motion.rel_x = rel_x; event.motion.rel_y = rel_y; + event.motion.rel_z = rel_z;return xenfb_kbd_event (xenfb, &event); }/* Send an absolute mouse movement event */ -static int xenfb_send_position (struct xenfb *xenfb,int abs_x,int abs_y) +static int xenfb_send_position (struct xenfb *xenfb,int abs_x,int abs_y,int abs_z) {union xenkbd_in_event event;
@@ -613,6 +614,7 @@ static int xenfb_send_position(struct xe event.type =XENKBD_TYPE_POS ; event.pos.abs_x = abs_x; event.pos.abs_y = abs_y; + event.pos.abs_z = abs_z;return xenfb_kbd_event (xenfb, &event); }
@@ -1043,9 +1045,10 @@ static void xenfb_mouse_event(void *opaqif (xenfb->abs_pointer_wanted)xenfb_send_position (xenfb, dx * xenfb->ds->width /0x7fff , - dy * xenfb->ds->height /0x7fff ); + dy * xenfb->ds->height /0x7fff , + dz);else -xenfb_send_motion (xenfb, dx, dy); +xenfb_send_motion (xenfb, dx, dy, dz);for (i =0 ; i <8 ; i++) {int lastDown = xenfb->button_state & (1 << i);
xen/include/public/io/kbdif.h +2 -0
@@ -50,6 +50,7 @@ struct xenkbd_motionuint8_t type;/* XENKBD_TYPE_MOTION */ int32_t rel_x;/* relative X motion */ int32_t rel_y;/* relative Y motion */ +int32_t rel_z;/* relative Z motion (wheel) */ };struct xenkbd_key
@@ -64,6 +65,7 @@ struct xenkbd_positionuint8_t type;/* XENKBD_TYPE_POS */ int32_t abs_x;/* absolute X position (in FB pixels) */ int32_t abs_y;/* absolute Y position (in FB pixels) */ +int32_t abs_z;/* absolute Z position (wheel) */ };#define XENKBD_IN_EVENT_SIZE 40
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel