This fixes the following case:

1) Ctrl-Alt-2 for console is pressed
2) console pops up and gets focus
3) console receives the Ctrl-Alt-2 keypress event
4) console closes
5) focus returns to the main window
6) main window gets the keypress event
7) goto 2 until the key is released, with 50% chance that the console
window is shown at the end


On Wed, Nov 1, 2017 at 11:40 AM Gerd Hoffmann <kra...@redhat.com> wrote:

> Why?
>
> > ---
> >  ui/sdl2.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ui/sdl2.c b/ui/sdl2.c
> > index 685e4fabec..fa54353430 100644
> > --- a/ui/sdl2.c
> > +++ b/ui/sdl2.c
> > @@ -349,7 +349,7 @@ static void handle_keydown(SDL_Event *ev)
> >      }
> >      gui_key_modifier_pressed = mod_state;
> >
> > -    if (gui_key_modifier_pressed) {
> > +    if (gui_key_modifier_pressed && !ev->key.repeat &&
> > qemu_console_is_graphic(scon->dcl.con)) {
> >          switch (ev->key.keysym.scancode) {
> >          case SDL_SCANCODE_2:
> >          case SDL_SCANCODE_3:
>
-- 
Jindřich Makovička

Reply via email to