From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuPbN-0004vQ-Kc for qemu-devel@nongnu.org; Wed, 03 Jul 2013 12:08:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuPbM-0004ZA-4p for qemu-devel@nongnu.org; Wed, 03 Jul 2013 12:08:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39840 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuPbL-0004Yu-Rs for qemu-devel@nongnu.org; Wed, 03 Jul 2013 12:08:16 -0400 Message-ID: <51D44C6B.8020001@suse.de> Date: Wed, 03 Jul 2013 18:08:11 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1372855818-15337-1-git-send-email-eugene.shatokhin@rosalab.ru> In-Reply-To: <1372855818-15337-1-git-send-email-eugene.shatokhin@rosalab.ru> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] monitor: Fix 'mouse_button': do not move mouse List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eugene Shatokhin Cc: Gerd Hoffmann , qemu-devel@nongnu.org, Luiz Capitulino Am 03.07.2013 14:50, schrieb Eugene Shatokhin: > If absolute positions are used, 'mouse_button' command moved mouse > pointer to (0, 0) before generating a mouse button event. The event was > therefore generated at incorrect position. >=20 > This problem is now fixed. >=20 > Signed-off-by: Eugene Shatokhin This patch has been rejected before. I had suggested a different solution but that was not fully accepted either and I haven't respun yet: http://lists.nongnu.org/archive/html/qemu-devel/2013-06/msg02506.html Andreas > --- > monitor.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) >=20 > diff --git a/monitor.c b/monitor.c > index 9be515c..d742942 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -1267,6 +1267,9 @@ static void do_sum(Monitor *mon, const QDict *qdi= ct) > monitor_printf(mon, "%05d\n", sum); > } > =20 > +static int mouse_x; > +static int mouse_y; > +static int mouse_z; > static int mouse_button_state; > =20 > static void do_mouse_move(Monitor *mon, const QDict *qdict) > @@ -1281,13 +1284,22 @@ static void do_mouse_move(Monitor *mon, const Q= Dict *qdict) > if (dz_str) > dz =3D strtol(dz_str, NULL, 0); > kbd_mouse_event(dx, dy, dz, mouse_button_state); > + if (kbd_mouse_is_absolute()) { > + mouse_x =3D dx; > + mouse_y =3D dy; > + mouse_z =3D dz; > + } > } > =20 > static void do_mouse_button(Monitor *mon, const QDict *qdict) > { > int button_state =3D qdict_get_int(qdict, "button_state"); > mouse_button_state =3D button_state; > - kbd_mouse_event(0, 0, 0, mouse_button_state); > + if (kbd_mouse_is_absolute()) { > + kbd_mouse_event(mouse_x, mouse_y, mouse_z, mouse_button_state)= ; > + } else { > + kbd_mouse_event(0, 0, 0, mouse_button_state); > + } > } > =20 > static void do_ioport_read(Monitor *mon, const QDict *qdict) >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg