提交 74d9dc69 编写于 作者: J Jan Kiszka 提交者: Anthony Liguori

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: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 f623d885
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册