From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Eric Blake <eblake@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
libvir-list@redhat.com
Subject: Re: [PATCH] ui: Remove deprecated parameters of -display sdl and switch to QAPI parser
Date: Wed, 11 May 2022 13:40:03 +0100 [thread overview]
Message-ID: <Ynuuo02cDee1nsZL@redhat.com> (raw)
In-Reply-To: <20220511121725.842448-1-thuth@redhat.com>
On Wed, May 11, 2022 at 02:17:25PM +0200, Thomas Huth wrote:
> The "-display sdl" option still used a hand-crafted parser for its
> parameters since some of them used underscores which is forbidden
> in QAPI. Now that they've been deprecated and the deprecation period
> is over, we can remove the problematic parameters and switch to use
> the QAPI parser instead.
I'd say the removal of deprecated bits ought to be separate
from the addition of new QAPI bits.
> diff --git a/qapi/ui.json b/qapi/ui.json
> index 059302a5ef..7d5097808a 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -1309,6 +1309,19 @@
> '*swap-opt-cmd': 'bool'
> } }
>
> +##
> +# @DisplaySDL:
> +#
> +# SDL2 display options.
> +#
> +# @grab-mod: Modifier keys that should be pressed together
> +# with "G" to release the mouse grab.
> +#
> +# Since: 7.1
> +##
> +{ 'struct' : 'DisplaySDL',
> + 'data' : { '*grab-mod' : 'str' } }
So any arbitrary string here, but...
> diff --git a/ui/sdl2.c b/ui/sdl2.c
> index d3741f9b75..18c63e1fc9 100644
> --- a/ui/sdl2.c
> +++ b/ui/sdl2.c
> @@ -40,6 +40,8 @@ static struct sdl2_console *sdl2_console;
>
> static SDL_Surface *guest_sprite_surface;
> static int gui_grab; /* if true, all keyboard/mouse events are grabbed */
> +static bool alt_grab;
> +static bool ctrl_grab;
>
> static int gui_saved_grab;
> static int gui_fullscreen;
> @@ -853,6 +855,17 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
>
> gui_fullscreen = o->has_full_screen && o->full_screen;
>
> + if (o->u.sdl.has_grab_mod) {
> + if (g_str_equal(o->u.sdl.grab_mod, "lshift-lctrl-lalt")) {
> + alt_grab = true;
> + } else if (g_str_equal(o->u.sdl.grab_mod, "rctrl")) {
> + ctrl_grab = true;
> + } else {
> + error_report("Unsupported grab-mod: %s", o->u.sdl.grab_mod);
> + exit(1);
> + }
> + }
We're treating this more like an enum here. It does leave the door
open for adding a generic parsing of arbitrary grab mods later
I guess
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2022-05-11 12:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 12:17 [PATCH] ui: Remove deprecated parameters of -display sdl and switch to QAPI parser Thomas Huth
2022-05-11 12:40 ` Daniel P. Berrangé [this message]
2022-05-11 12:57 ` Thomas Huth
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=Ynuuo02cDee1nsZL@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.