From: "Andreas Färber" <afaerber@suse.de>
To: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] monitor: Fix 'mouse_button': do not move mouse
Date: Wed, 03 Jul 2013 18:08:11 +0200 [thread overview]
Message-ID: <51D44C6B.8020001@suse.de> (raw)
In-Reply-To: <1372855818-15337-1-git-send-email-eugene.shatokhin@rosalab.ru>
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.
>
> This problem is now fixed.
>
> Signed-off-by: Eugene Shatokhin <eugene.shatokhin@rosalab.ru>
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(-)
>
> 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 *qdict)
> monitor_printf(mon, "%05d\n", sum);
> }
>
> +static int mouse_x;
> +static int mouse_y;
> +static int mouse_z;
> static int mouse_button_state;
>
> static void do_mouse_move(Monitor *mon, const QDict *qdict)
> @@ -1281,13 +1284,22 @@ static void do_mouse_move(Monitor *mon, const QDict *qdict)
> if (dz_str)
> dz = strtol(dz_str, NULL, 0);
> kbd_mouse_event(dx, dy, dz, mouse_button_state);
> + if (kbd_mouse_is_absolute()) {
> + mouse_x = dx;
> + mouse_y = dy;
> + mouse_z = dz;
> + }
> }
>
> static void do_mouse_button(Monitor *mon, const QDict *qdict)
> {
> int button_state = qdict_get_int(qdict, "button_state");
> mouse_button_state = 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);
> + }
> }
>
> static void do_ioport_read(Monitor *mon, const QDict *qdict)
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-07-03 16:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-03 12:50 [Qemu-devel] [PATCH] monitor: Fix 'mouse_button': do not move mouse Eugene Shatokhin
2013-07-03 16:08 ` Andreas Färber [this message]
2013-07-03 19:02 ` Eugene Shatokhin
2014-02-25 12:21 ` Eugene Shatokhin
2014-02-25 12:43 ` Gerd Hoffmann
2014-02-25 13:54 ` Eugene Shatokhin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51D44C6B.8020001@suse.de \
--to=afaerber@suse.de \
--cc=eugene.shatokhin@rosalab.ru \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).