qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 4/7] sdl2: Only accept the hotkeys on the main w


From: Jindřich Makovička
Subject: Re: [Qemu-devel] [PATCH 4/7] sdl2: Only accept the hotkeys on the main window
Date: Thu, 02 Nov 2017 17:12:11 +0000

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 <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]