Skip to content
  • Jindřich Makovička's avatar
    849bbe60
    sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held · 849bbe60
    Jindřich Makovička authored
    
    
    When SDL2 windows change focus while a key is held, the window that
    receives the focus also receives a new KeyDown event, without an
    autorepeat flag. This means that if a WM places the qemu console
    over the main window after Ctrl-Alt-2, the console closes immediately
    after opening. Then, the main window receives the KeyDown event again
    and the whole process repeats.
    
    This patch makes the SDL2 UI ignore the KeyDown events on a window that
    just received the focus, if the GUI modifier was held. The ignore flag
    is reset on a first KeyUp event. This effectively works around the issue
    above.
    
    Signed-off-by: default avatarJindrich Makovicka <makovick@gmail.com>
    Message-Id: <20171117112258.5888-4-makovick@gmail.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
    849bbe60
    sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held
    Jindřich Makovička authored
    
    
    When SDL2 windows change focus while a key is held, the window that
    receives the focus also receives a new KeyDown event, without an
    autorepeat flag. This means that if a WM places the qemu console
    over the main window after Ctrl-Alt-2, the console closes immediately
    after opening. Then, the main window receives the KeyDown event again
    and the whole process repeats.
    
    This patch makes the SDL2 UI ignore the KeyDown events on a window that
    just received the focus, if the GUI modifier was held. The ignore flag
    is reset on a first KeyUp event. This effectively works around the issue
    above.
    
    Signed-off-by: default avatarJindrich Makovicka <makovick@gmail.com>
    Message-Id: <20171117112258.5888-4-makovick@gmail.com>
    Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Loading