From: Cole Robinson <crobinso@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>, Cole Robinson <crobinso@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] input: sdl2: Fix guest_cursor logic
Date: Tue, 1 Apr 2014 16:37:10 -0400 [thread overview]
Message-ID: <306f9047dd19b35e6960a6d046aefd06a7121d08.1396383249.git.crobinso@redhat.com> (raw)
In-Reply-To: <cover.1396383249.git.crobinso@redhat.com>
In-Reply-To: <cover.1396383249.git.crobinso@redhat.com>
Unbreaks relative mouse mode with sdl2, just like was done with sdl.c
in c3aa84b6.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
ui/sdl2.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index f1532e9..e4cb9fb 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -403,13 +403,17 @@ static void sdl_send_mouse_event(struct sdl2_state *scon, int dx, int dy,
}
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_X, off_x + x, max_w);
qemu_input_queue_abs(scon->dcl.con, INPUT_AXIS_Y, off_y + y, max_h);
- } else if (guest_cursor) {
- x -= guest_x;
- y -= guest_y;
- guest_x += x;
- guest_y += y;
- qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_X, x);
- qemu_input_queue_rel(scon->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(scon->dcl.con, INPUT_AXIS_X, dx);
+ qemu_input_queue_rel(scon->dcl.con, INPUT_AXIS_Y, dy);
}
qemu_input_event_sync();
}
--
1.9.0
next prev parent reply other threads:[~2014-04-01 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 20:37 [Qemu-devel] [PATCH 0/2] sdl2: Fix relative mouse mode Cole Robinson
2014-04-01 20:37 ` Cole Robinson [this message]
2014-04-01 20:37 ` [Qemu-devel] [RFC PATCH 2/2] input: sdl2: Fix relative mode to match SDL1 behavior Cole Robinson
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=306f9047dd19b35e6960a6d046aefd06a7121d08.1396383249.git.crobinso@redhat.com \
--to=crobinso@redhat.com \
--cc=kraxel@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).