All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Cole Robinson <crobinso@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 02/12] ui: sdl2: Release grab before opening console window
Date: Tue, 10 May 2016 07:51:47 +0200	[thread overview]
Message-ID: <1462859517-30207-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1462859517-30207-1-git-send-email-kraxel@redhat.com>

From: Cole Robinson <crobinso@redhat.com>

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 <crobinso@redhat.com>
Message-id: 31c9ab6540b031f7a614c59edcecea9877685612.1462557436.git.crobinso@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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

  parent reply	other threads:[~2016-05-10  5:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  5:51 [Qemu-devel] [PULL 00/12] ui patch queue Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 01/12] ui: gtk: fix crash when terminal inner-border is NULL Gerd Hoffmann
2016-05-10  5:51 ` Gerd Hoffmann [this message]
2016-05-10  5:51 ` [Qemu-devel] [PULL 03/12] configure: build SDL if only SDL2 available Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 04/12] configure: error on unknown --with-sdlabi value Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 05/12] configure: add echo_version helper Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 06/12] configure: report GTK version Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 07/12] configure: report SDL version Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 08/12] configure: support vte-2.91 Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 09/12] ui: gtk: Fix a runtime warning on vte >= 0.37 Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 10/12] ui: gtk: Fix some deprecation warnings Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 11/12] ui/gtk: copy to clipboard support Gerd Hoffmann
2016-05-10  5:51 ` [Qemu-devel] [PULL 12/12] spice/gl: add & use qemu_spice_gl_monitor_config Gerd Hoffmann
2016-05-10 14:08 ` [Qemu-devel] [PULL 00/12] ui patch queue Cole Robinson
2016-05-12 13:26 ` Peter Maydell
2016-05-12 13:57   ` Gerd Hoffmann
2016-05-13  7:56     ` Gerd Hoffmann
2016-05-13 10:13       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462859517-30207-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=crobinso@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.