[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 02/17] ui: sdl2: Release grab before opening conso
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL v2 02/17] ui: sdl2: Release grab before opening console window |
Date: |
Fri, 13 May 2016 14:32:42 +0200 |
From: Cole Robinson <address@hidden>
sdl 2.0.4 currently has a bug which causes our UI shortcuts to fire
rapidly in succession:
https://bugzilla.libsdl.org/show_bug.cgi?id=3287
It's a toss up whether ctrl+alt+f or ctrl+alt+2 will fire an
odd or even number of times, thus determining whether the action
succeeds or fails.
Opening monitor/serial windows is doubly broken, since it will often
lock the UI trying to grab the pointer:
0x00007fffef3720a5 in SDL_Delay_REAL () at /lib64/libSDL2-2.0.so.0
0x00007fffef3688ba in X11_SetWindowGrab () at /lib64/libSDL2-2.0.so.0
0x00007fffef2f2da7 in SDL_SendWindowEvent () at /lib64/libSDL2-2.0.so.0
0x00007fffef2f080b in SDL_SetKeyboardFocus () at /lib64/libSDL2-2.0.so.0
0x00007fffef35d784 in X11_DispatchFocusIn.isra.8 () at /lib64/libSDL2-2.0.so.0
0x00007fffef35dbce in X11_DispatchEvent () at /lib64/libSDL2-2.0.so.0
0x00007fffef35ee4a in X11_PumpEvents () at /lib64/libSDL2-2.0.so.0
0x00007fffef2eea6a in SDL_PumpEvents_REAL () at /lib64/libSDL2-2.0.so.0
0x00007fffef2eeab5 in SDL_WaitEventTimeout_REAL () at /lib64/libSDL2-2.0.so.0
0x000055555597eed0 in sdl2_poll_events (scon=0x55555876f928) at ui/sdl2.c:593
We can work around that hang by ungrabbing the pointer before launching
a new window. This roughly matches what our sdl1 code does
Signed-off-by: Cole Robinson <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/sdl2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index d042442..909038f 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -357,6 +357,10 @@ static void handle_keydown(SDL_Event *ev)
case SDL_SCANCODE_7:
case SDL_SCANCODE_8:
case SDL_SCANCODE_9:
+ if (gui_grab) {
+ sdl_grab_end(scon);
+ }
+
win = ev->key.keysym.scancode - SDL_SCANCODE_1;
if (win < sdl2_num_outputs) {
sdl2_console[win].hidden = !sdl2_console[win].hidden;
--
1.8.3.1
- [Qemu-devel] [PULL v2 00/17] ui patch queue, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 11/17] ui/gtk: copy to clipboard support, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 16/17] gtk: update grab code for gtk 3.20, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 02/17] ui: sdl2: Release grab before opening console window,
Gerd Hoffmann <=
- [Qemu-devel] [PULL v2 17/17] gtk: don't leak the GtkBorder with VTE 0.36, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 06/17] configure: report GTK version, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 04/17] configure: error on unknown --with-sdlabi value, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 12/17] spice/gl: add & use qemu_spice_gl_monitor_config, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 13/17] Changed malloc to g_malloc, free to g_free in ui/shader.c, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 10/17] ui: gtk: Fix some deprecation warnings, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 07/17] configure: report SDL version, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 05/17] configure: add echo_version helper, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 01/17] ui: gtk: fix crash when terminal inner-border is NULL, Gerd Hoffmann, 2016/05/13
- [Qemu-devel] [PULL v2 15/17] spice: fix coverity complains, Gerd Hoffmann, 2016/05/13