From patchwork Tue May 10 05:51:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9054411 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36394BF29F for ; Tue, 10 May 2016 05:54:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 629B320123 for ; Tue, 10 May 2016 05:54:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6464220114 for ; Tue, 10 May 2016 05:54:26 +0000 (UTC) Received: from localhost ([::1]:44605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b00cj-0001mY-Ge for patchwork-qemu-devel@patchwork.kernel.org; Tue, 10 May 2016 01:54:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b00aY-000697-JK for qemu-devel@nongnu.org; Tue, 10 May 2016 01:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b00aS-0001Cv-CQ for qemu-devel@nongnu.org; Tue, 10 May 2016 01:52:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b00aS-0001BH-6D for qemu-devel@nongnu.org; Tue, 10 May 2016 01:52:04 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04DFF7F0B8 for ; Tue, 10 May 2016 05:52:02 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-43.ams2.redhat.com [10.36.116.43]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4A5q0Ov007806; Tue, 10 May 2016 01:52:01 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 4F656828B7; Tue, 10 May 2016 07:51:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 May 2016 07:51:47 +0200 Message-Id: <1462859517-30207-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1462859517-30207-1-git-send-email-kraxel@redhat.com> References: <1462859517-30207-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 10 May 2016 05:52:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/12] ui: sdl2: Release grab before opening console window X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , Cole Robinson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Cole Robinson 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 Message-id: 31c9ab6540b031f7a614c59edcecea9877685612.1462557436.git.crobinso@redhat.com Signed-off-by: Gerd Hoffmann --- 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;