]> git.proxmox.com Git - mirror_qemu.git/commit
sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held
authorJindrich Makovicka <makovick@gmail.com>
Fri, 17 Nov 2017 11:22:58 +0000 (12:22 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 12 Jan 2018 14:51:18 +0000 (15:51 +0100)
commit849bbe60356caf3d320202d45f1ddffeefae06c7
tree6c6b9c2ea858efebef6969a0fd477b114d325b9c
parentd9f0626280fb5224071415e6fd82cc0c2e9d6590
sdl2: Ignore UI hotkeys after a focus change when GUI modifier is held

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: Jindrich Makovicka <makovick@gmail.com>
Message-Id: <20171117112258.5888-4-makovick@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
include/ui/sdl2.h
ui/sdl2.c