qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH v2 2/7] kbd-state: use state tracker for sdl2
Date: Fri, 21 Dec 2018 11:04:06 +0000	[thread overview]
Message-ID: <20181221110406.GF7439@redhat.com> (raw)
In-Reply-To: <20181219120904.17643-3-kraxel@redhat.com>

On Wed, Dec 19, 2018 at 01:08:59PM +0100, Gerd Hoffmann wrote:
> Use the new keyboard state tracked for sdl2.  We can drop the modifier
> state tracking from sdl2.  Also keyup code is simpler, the state tracker
> will take care to not send suspious keyup events to the guest.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  include/ui/sdl2.h |  2 ++
>  ui/sdl2-input.c   | 40 +++-------------------------------------
>  ui/sdl2.c         | 12 +++---------
>  3 files changed, 8 insertions(+), 46 deletions(-)
> 
> diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
> index f43eecdbd6..393f4b0fd5 100644
> --- a/include/ui/sdl2.h
> +++ b/include/ui/sdl2.h
> @@ -7,6 +7,7 @@

> diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c
> index 1378b63dd9..ae52d548f6 100644
> --- a/ui/sdl2-input.c
> +++ b/ui/sdl2-input.c
> @@ -30,22 +30,9 @@
>  #include "ui/sdl2.h"
>  #include "sysemu/sysemu.h"
>  
> -static uint8_t modifiers_state[SDL_NUM_SCANCODES];
> -
>  void sdl2_reset_keys(struct sdl2_console *scon)
>  {
> -    QemuConsole *con = scon ? scon->dcl.con : NULL;
> -    int i;
> -
> -    for (i = 0 ;
> -         i < SDL_NUM_SCANCODES && i < qemu_input_map_usb_to_qcode_len ;
> -         i++) {
> -        if (modifiers_state[i]) {
> -            int qcode = qemu_input_map_usb_to_qcode[i];
> -            qemu_input_event_send_key_qcode(con, qcode, false);
> -            modifiers_state[i] = 0;
> -        }
> -    }
> +    kbd_state_lift_all_keys(scon->kbd);
>  }

I was wondering if we could just make the callers of sdl2_reset_keys
call  kbd_state_lift_all_keys directly. I can't find any callers of
sdl2_reset_keys at all though. It appears you removed all callers
in

  commit f8d2c9369b8302f65f4f43f14ed3987c2268a02a
  Author: Gerd Hoffmann <kraxel@redhat.com>
  Date:   Mon Jan 15 16:48:54 2018 +0100

    sdl: use ctrl-alt-g as grab hotkey

So I guess we could have a prior patch that just deletes this method
entirely.


For the rest of the patch

  Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


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 :|

  reply	other threads:[~2018-12-21 11:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 12:08 [Qemu-devel] [RFC PATCH v2 0/7] ui: add generic keyboard state tracker, fix keymap Gerd Hoffmann
2018-12-19 12:08 ` [Qemu-devel] [RFC PATCH v2 1/7] kbd-state: add keyboard state tracker Gerd Hoffmann
2018-12-21 10:56   ` Daniel P. Berrangé
2019-01-22 16:52   ` Eric Blake
2019-01-23  6:20     ` Gerd Hoffmann
2018-12-19 12:08 ` [Qemu-devel] [RFC PATCH v2 2/7] kbd-state: use state tracker for sdl2 Gerd Hoffmann
2018-12-21 11:04   ` Daniel P. Berrangé [this message]
2019-01-22 16:58   ` Eric Blake
2018-12-19 12:09 ` [Qemu-devel] [RFC PATCH v2 3/7] sdl2: use only QKeyCode in sdl2_process_key() Gerd Hoffmann
2018-12-21 11:06   ` Daniel P. Berrangé
2018-12-19 12:09 ` [Qemu-devel] [RFC PATCH v2 4/7] kbd-state: use state tracker for gtk Gerd Hoffmann
2018-12-21 11:10   ` Daniel P. Berrangé
2018-12-19 12:09 ` [Qemu-devel] [RFC PATCH v2 5/7] kbd-state: use state tracker for vnc Gerd Hoffmann
2018-12-21 11:18   ` Daniel P. Berrangé
2019-01-22  9:00     ` Gerd Hoffmann
2019-01-22  9:41       ` Daniel P. Berrangé
2018-12-19 12:09 ` [Qemu-devel] [RFC PATCH v2 6/7] keymap: pass full keyboard state to keysym2scancode Gerd Hoffmann
2018-12-21 11:18   ` Daniel P. Berrangé
2018-12-19 12:09 ` [Qemu-devel] [RFC PATCH v2 7/7] keymap: fix keyup mappings Gerd Hoffmann
2018-12-21 11:19   ` Daniel P. Berrangé
2018-12-25  6:46 ` [Qemu-devel] [RFC PATCH v2 0/7] ui: add generic keyboard state tracker, fix keymap no-reply

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=20181221110406.GF7439@redhat.com \
    --to=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).