summaryrefslogtreecommitdiff
path: root/ui/sdl.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-07-30 11:39:14 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-05 10:57:35 -0500
commit74d9dc69abebdbf22b9473708aefd47ab53475dd (patch)
tree16ace5a0aa210f3b629f7ccbbc12810a8de10454 /ui/sdl.c
parentf623d885480b7899a445c9ef7aaa95db52820bc1 (diff)
downloadqemu-74d9dc69abebdbf22b9473708aefd47ab53475dd.tar.gz
sdl: Fix cursor handling when switching consoles in absolute mouse mode
Restore the cursor when switching from graphic to text console while the mouse is in absolute mode. Disable it again when returning. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui/sdl.c')
-rw-r--r--ui/sdl.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/sdl.c b/ui/sdl.c
index 662ffef46d..5ad38d5460 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -452,7 +452,7 @@ static void sdl_show_cursor(void)
if (!cursor_hide)
return;
- if (!kbd_mouse_is_absolute()) {
+ if (!kbd_mouse_is_absolute() || !is_graphic_console()) {
SDL_ShowCursor(1);
if (guest_cursor &&
(gui_grab || kbd_mouse_is_absolute() || absolute_enabled))
@@ -625,13 +625,20 @@ static void sdl_refresh(DisplayState *ds)
/* Reset the modifiers sent to the current console */
reset_keys();
console_select(keycode - 0x02);
+ gui_keysym = 1;
+ if (gui_fullscreen) {
+ break;
+ }
if (!is_graphic_console()) {
/* release grab if going to a text console */
- if (gui_grab && !gui_fullscreen) {
+ if (gui_grab) {
sdl_grab_end();
+ } else if (absolute_enabled) {
+ sdl_show_cursor();
}
+ } else if (absolute_enabled) {
+ sdl_hide_cursor();
}
- gui_keysym = 1;
break;
default:
break;