}
}
-static void sdl_hide_cursor(void)
+static void sdl_hide_cursor(struct sdl2_console *scon)
{
- if (!cursor_hide) {
+ if (scon->opts->has_show_cursor && scon->opts->show_cursor) {
return;
}
}
}
-static void sdl_show_cursor(void)
+static void sdl_show_cursor(struct sdl2_console *scon)
{
- if (!cursor_hide) {
+ if (scon->opts->has_show_cursor && scon->opts->show_cursor) {
return;
}
SDL_WarpMouseInWindow(scon->real_window, guest_x, guest_y);
}
} else {
- sdl_hide_cursor();
+ sdl_hide_cursor(scon);
}
SDL_SetWindowGrab(scon->real_window, SDL_TRUE);
gui_grab = 1;
{
SDL_SetWindowGrab(scon->real_window, SDL_FALSE);
gui_grab = 0;
- sdl_show_cursor();
+ sdl_show_cursor(scon);
sdl_update_caption(scon);
}
if (on) {
if (!guest_cursor) {
- sdl_show_cursor();
+ sdl_show_cursor(scon);
}
if (gui_grab || qemu_input_is_absolute() || absolute_enabled) {
SDL_SetCursor(guest_sprite);
}
}
} else if (gui_grab) {
- sdl_hide_cursor();
+ sdl_hide_cursor(scon);
}
guest_cursor = on;
guest_x = x, guest_y = y;
} else {
goto invalid_sdl_args;
}
+ } else if (strstart(opts, ",show-cursor=", &nextopt)) {
+ opts = nextopt;
+ dpy.has_show_cursor = true;
+ if (strstart(opts, "on", &nextopt)) {
+ dpy.show_cursor = true;
+ } else if (strstart(opts, "off", &nextopt)) {
+ dpy.show_cursor = false;
+ } else {
+ goto invalid_sdl_args;
+ }
} else if (strstart(opts, ",gl=", &nextopt)) {
opts = nextopt;
dpy.has_gl = true;