From nobody Fri Apr 19 11:25:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528910896511759.0960221649956; Wed, 13 Jun 2018 10:28:16 -0700 (PDT) Received: from localhost ([::1]:35854 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT9Z9-0002ol-Qh for importer@patchew.org; Wed, 13 Jun 2018 13:28:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT9WT-0001AI-93 for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:25:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT9WO-0005LX-1K for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:25:29 -0400 Received: from srv2.anyservers.com ([77.79.239.202]:46046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fT9WN-0005Ej-Oz for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:25:23 -0400 Received: from [31.1.65.12] (port=35992 helo=milkyway.galaxy) by srv2.anyservers.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1fT9WJ-008XaD-9h; Wed, 13 Jun 2018 19:25:19 +0200 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= To: Gerd Hoffmann , qemu-devel@nongnu.org Date: Wed, 13 Jun 2018 19:27:07 +0200 Message-Id: <20180613172707.31530-1-amade@asmblr.net> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - srv2.anyservers.com X-AntiAbuse: Original Domain - nongnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - asmblr.net X-Get-Message-Sender-Via: srv2.anyservers.com: authenticated_id: amade@asmblr.net X-Authenticated-Sender: srv2.anyservers.com: amade@asmblr.net X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 77.79.239.202 Subject: [Qemu-devel] [PATCH] sdl2: restore window dimensions by resize 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: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 instead of destroying and recreating window, fixes segfault caused by handle_keyup trying to access no more existing window when using Ctrl-Alt-U to restore window "un-scaled" dimensions Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7f92b80 (LWP 3711)] handle_keyup (ev=3D0x7fffffffd010) at ui/sdl2.c:416 416 scon->ignore_hotkeys =3D false; (gdb) bt #0 handle_keyup (ev=3D0x7fffffffd010) at ui/sdl2.c:416 #1 sdl2_poll_events (scon=3D0x100fee5a8) at ui/sdl2.c:608 #2 0x0000000100585bf2 in dpy_refresh (s=3D0x101ad3e00) at ui/console.c:16= 58 #3 gui_update (opaque=3D0x101ad3e00) at ui/console.c:205 #4 0x0000000100690f2c in timerlist_run_timers (timer_list=3D0x100ede130) = at util/qemu-timer.c:536 #5 0x0000000100691177 in qemu_clock_run_timers (type=3DQEMU_CLOCK_REALTIM= E) at util/qemu-timer.c:547 #6 qemu_clock_run_all_timers () at util/qemu-timer.c:674 #7 0x0000000100691651 in main_loop_wait (nonblocking=3D) a= t util/main-loop.c:503 #8 0x00000001003d650f in main_loop () at vl.c:1848 #9 0x0000000100289681 in main (argc=3D, argv=3D, envp=3D) at vl.c:4605 Signed-off-by: Amadeusz S=C5=82awi=C5=84ski --- ui/sdl2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index a0f9b16bc1..3ae4719c32 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -371,8 +371,7 @@ static void handle_keydown(SDL_Event *ev) } break; case SDL_SCANCODE_U: - sdl2_window_destroy(scon); - sdl2_window_create(scon); + sdl2_window_resize(scon); if (!scon->opengl) { /* re-create scon->texture */ sdl2_2d_switch(&scon->dcl, scon->surface); --=20 2.17.1