aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2022-05-19 17:56:24 +0200
committerThomas Huth <thuth@redhat.com>2022-06-03 08:03:28 +0200
commit9eafdeeac3513eb515c0e602fc56aa73353cf20d (patch)
tree674b90cf190aef4111d90f8bb3f57e7db5366533 /softmmu
parenta743d60bcaa6a3a33f4376f87c1fc7cc977bc811 (diff)
ui: Switch "-display sdl" to use the QAPI parser
The "-display sdl" option still uses a hand-crafted parser for its parameters since we didn't want to drag an interface we considered somewhat flawed into the QAPI schema. Since the flaws are gone now, it's time to QAPIfy. This introduces the new "DisplaySDL" QAPI struct that is used to hold the parameters that are unique to the SDL display. The only specific parameter is currently "grab-mod" that is used to specify the required modifier keys to escape from the mouse grabbing mode. Message-Id: <20220519155625.1414365-3-thuth@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/globals.c2
-rw-r--r--softmmu/vl.c70
2 files changed, 1 insertions, 71 deletions
diff --git a/softmmu/globals.c b/softmmu/globals.c
index 916bc12e2b..527edbefdd 100644
--- a/softmmu/globals.c
+++ b/softmmu/globals.c
@@ -50,8 +50,6 @@ QEMUOptionRom option_rom[MAX_OPTION_ROMS];
int nb_option_roms;
int old_param;
const char *qemu_name;
-int alt_grab;
-int ctrl_grab;
unsigned int nb_prom_envs;
const char *prom_envs[MAX_PROM_ENVS];
uint8_t *boot_splash_filedata;
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 57ab9d5322..484e9d9921 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1056,75 +1056,7 @@ static void parse_display(const char *p)
exit(0);
}
- if (strstart(p, "sdl", &opts)) {
- /*
- * sdl DisplayType needs hand-crafted parser instead of
- * parse_display_qapi() due to some options not in
- * DisplayOptions, specifically:
- * - ctrl_grab + alt_grab
- * They can't be moved into the QAPI since they use underscores,
- * thus they will get replaced by "grab-mod" in the long term
- */
-#if defined(CONFIG_SDL)
- dpy.type = DISPLAY_TYPE_SDL;
- while (*opts) {
- const char *nextopt;
-
- if (strstart(opts, ",grab-mod=", &nextopt)) {
- opts = nextopt;
- if (strstart(opts, "lshift-lctrl-lalt", &nextopt)) {
- alt_grab = 1;
- } else if (strstart(opts, "rctrl", &nextopt)) {
- ctrl_grab = 1;
- } else {
- goto invalid_sdl_args;
- }
- } else if (strstart(opts, ",window-close=", &nextopt)) {
- opts = nextopt;
- dpy.has_window_close = true;
- if (strstart(opts, "on", &nextopt)) {
- dpy.window_close = true;
- } else if (strstart(opts, "off", &nextopt)) {
- dpy.window_close = false;
- } 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;
- if (strstart(opts, "on", &nextopt)) {
- dpy.gl = DISPLAYGL_MODE_ON;
- } else if (strstart(opts, "core", &nextopt)) {
- dpy.gl = DISPLAYGL_MODE_CORE;
- } else if (strstart(opts, "es", &nextopt)) {
- dpy.gl = DISPLAYGL_MODE_ES;
- } else if (strstart(opts, "off", &nextopt)) {
- dpy.gl = DISPLAYGL_MODE_OFF;
- } else {
- goto invalid_sdl_args;
- }
- } else {
- invalid_sdl_args:
- error_report("invalid SDL option string");
- exit(1);
- }
- opts = nextopt;
- }
-#else
- error_report("SDL display supported is not available in this binary");
- exit(1);
-#endif
- } else if (strstart(p, "vnc", &opts)) {
+ if (strstart(p, "vnc", &opts)) {
/*
* vnc isn't a (local) DisplayType but a protocol for remote
* display access.