From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
Anthony Liguori <aliguori@amazon.com>,
Cole Robinson <crobinso@redhat.com>
Subject: [Qemu-devel] [PULL 2/2] input: sdl2: Fix relative mode to match SDL1 behavior
Date: Fri, 11 Apr 2014 12:40:16 +0200 [thread overview]
Message-ID: <1397212816-19891-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1397212816-19891-1-git-send-email-kraxel@redhat.com>
From: Cole Robinson <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>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
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.8.3.1
next prev parent reply other threads:[~2014-04-11 11:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 10:40 [Qemu-devel] [PULL for-2.0 0/2] sdl2: relative mouse mode fixes Gerd Hoffmann
2014-04-11 10:40 ` [Qemu-devel] [PULL 1/2] input: sdl2: Fix guest_cursor logic Gerd Hoffmann
2014-04-11 10:40 ` Gerd Hoffmann [this message]
2014-04-11 13:09 ` [Qemu-devel] [PULL for-2.0 0/2] sdl2: relative mouse mode fixes 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=1397212816-19891-3-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=aliguori@amazon.com \
--cc=crobinso@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).