From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 1/2] input: sdl: fix guest_cursor logic.
Date: Mon, 10 Mar 2014 13:54:34 +0100 [thread overview]
Message-ID: <1394456075-20371-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1394456075-20371-1-git-send-email-kraxel@redhat.com>
Unbreaks relative mouse mode with SDL.
Reported-by: Gabriel L. Somlo <gsomlo@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/sdl.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/ui/sdl.c b/ui/sdl.c
index c1a16be..4e7f920 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -455,13 +455,17 @@ static void sdl_send_mouse_event(int dx, int dy, int x, int y, int state)
real_screen->w);
qemu_input_queue_abs(dcl->con, INPUT_AXIS_Y, y,
real_screen->h);
- } else if (guest_cursor) {
- x -= guest_x;
- y -= guest_y;
- guest_x += x;
- guest_y += y;
- qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, x);
- qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, y);
+ } else {
+ if (guest_cursor) {
+ x -= guest_x;
+ y -= guest_y;
+ guest_x += x;
+ guest_y += y;
+ dx = x;
+ dy = y;
+ }
+ qemu_input_queue_rel(dcl->con, INPUT_AXIS_X, dx);
+ qemu_input_queue_rel(dcl->con, INPUT_AXIS_Y, dy);
}
qemu_input_event_sync();
}
--
1.8.3.1
next prev parent reply other threads:[~2014-03-10 12:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 12:54 [Qemu-devel] [PULL 0/2] input: two bugfixes Gerd Hoffmann
2014-03-10 12:54 ` Gerd Hoffmann [this message]
2014-03-10 12:54 ` [Qemu-devel] [PULL 2/2] input: map INPUT_BUTTON_WHEEL_{UP, DOWN} to legacy input z axis moves Gerd Hoffmann
2014-03-11 13:05 ` [Qemu-devel] [PULL 0/2] input: two bugfixes Peter Maydell
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=1394456075-20371-2-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=aliguori@amazon.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).