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] [RFC PATCH 2/2] input: sdl2: Fix relative mode to match SDL1 behavior
Date: Tue, 1 Apr 2014 16:37:11 -0400 [thread overview]
Message-ID: <69d314c56efa6d68d3cdf0c56344469c0b70c175.1396383249.git.crobinso@redhat.com> (raw)
In-Reply-To: <cover.1396383249.git.crobinso@redhat.com>
In-Reply-To: <cover.1396383249.git.crobinso@redhat.com>
Right now relative mode accelerates too fast, and has the 'invisible wall'
problem. SDL2 added an explicit API to handle this use case, so let's use
it.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
While this fixes things for me, I'm not positive it doesn't have other
side effects. I didn't test transition from relative mode to absolute
mode and back, which might hit issues.
ui/sdl2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index e4cb9fb..7506e2e 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -278,7 +278,7 @@ static void sdl_hide_cursor(void)
SDL_ShowCursor(1);
SDL_SetCursor(sdl_cursor_hidden);
} else {
- SDL_ShowCursor(0);
+ SDL_SetRelativeMouseMode(SDL_TRUE);
}
}
@@ -289,6 +289,7 @@ static void sdl_show_cursor(void)
}
if (!qemu_input_is_absolute()) {
+ SDL_SetRelativeMouseMode(SDL_FALSE);
SDL_ShowCursor(1);
if (guest_cursor &&
(gui_grab || qemu_input_is_absolute() || absolute_enabled)) {
--
1.9.0
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 ` [Qemu-devel] [PATCH 1/2] input: sdl2: Fix guest_cursor logic Cole Robinson
2014-04-01 20:37 ` Cole Robinson [this message]
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=69d314c56efa6d68d3cdf0c56344469c0b70c175.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).