From: "Pat Campbell" Subject: [PATCH][IOEMU] Include mouse dz in xenfb event packet Date: Mon, 10 Dec 2007 06:27:50 -0700 Message-ID: <475CDB7C.3E48.0018.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8AAC9DC6.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=__Part8AAC9DC6.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --=__Part8AAC9DC6.0__= Content-Type: text/plain; name="xenfb-dz.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xenfb-dz.patch" diff -r d4a3479e68ce tools/ioemu/hw/xenfb.c --- a/tools/ioemu/hw/xenfb.c Fri Dec 07 18:24:33 2007 +0000 +++ b/tools/ioemu/hw/xenfb.c Sat Dec 08 13:00:49 2007 -0700 @@ -592,7 +592,7 @@ static int xenfb_send_key(struct xenfb * } =20 /* 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; =20 @@ -600,12 +600,13 @@ static int xenfb_send_motion(struct xenf event.type =3D XENKBD_TYPE_MOTION; event.motion.rel_x =3D rel_x; event.motion.rel_y =3D rel_y; + event.motion.rel_z =3D rel_z; =20 return xenfb_kbd_event(xenfb, &event); } =20 /* 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; =20 @@ -613,6 +614,7 @@ static int xenfb_send_position(struct xe event.type =3D XENKBD_TYPE_POS; event.pos.abs_x =3D abs_x; event.pos.abs_y =3D abs_y; + event.pos.abs_z =3D abs_z; =20 return xenfb_kbd_event(xenfb, &event); } @@ -1043,9 +1045,10 @@ static void xenfb_mouse_event(void *opaq if (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); =20 for (i =3D 0 ; i < 8 ; i++) { int lastDown =3D xenfb->button_state & (1 << i); diff -r d4a3479e68ce xen/include/public/io/kbdif.h --- a/xen/include/public/io/kbdif.h Fri Dec 07 18:24:33 2007 +0000 +++ b/xen/include/public/io/kbdif.h Sat Dec 08 12:56:46 2007 -0700 @@ -50,6 +50,7 @@ struct xenkbd_motion uint8_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) */ }; =20 struct xenkbd_key @@ -64,6 +65,7 @@ struct xenkbd_position uint8_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) */ }; =20 #define XENKBD_IN_EVENT_SIZE 40 --=__Part8AAC9DC6.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part8AAC9DC6.0__=--