diff options
author | Jindrich Makovicka | 2017-11-17 12:22:58 +0100 |
---|---|---|
committer | Gerd Hoffmann | 2018-01-12 15:51:18 +0100 |
commit | 849bbe60356caf3d320202d45f1ddffeefae06c7 (patch) | |
tree | 6c6b9c2ea858efebef6969a0fd477b114d325b9c /include/ui | |
parent | sdl2 uses surface relative coordinates (diff) | |
download | qemu-849bbe60356caf3d320202d45f1ddffeefae06c7.tar.gz qemu-849bbe60356caf3d320202d45f1ddffeefae06c7.tar.xz qemu-849bbe60356caf3d320202d45f1ddffeefae06c7.zip |
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>
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/sdl2.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index b29cf803c9..51084e6320 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -24,6 +24,7 @@ struct sdl2_console { int opengl; int updates; int idle_counter; + int ignore_hotkeys; SDL_GLContext winctx; #ifdef CONFIG_OPENGL QemuGLShader *gls; |