From nobody Wed Oct 29 09:06:54 2025 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524823408278206.8163444439091; Fri, 27 Apr 2018 03:03:28 -0700 (PDT) Received: from localhost ([::1]:46929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC0Dv-00060F-EO for importer@patchew.org; Fri, 27 Apr 2018 06:03:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41137) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC05S-0007P0-U5 for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fC05R-0001fT-VU for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:54:43 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55250 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fC05R-0001ez-R0 for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:54:41 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 575FF4023112; Fri, 27 Apr 2018 09:54:41 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03076AB3F1; Fri, 27 Apr 2018 09:54:41 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 45F1B3EB8A; Fri, 27 Apr 2018 11:54:34 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 27 Apr 2018 11:54:31 +0200 Message-Id: <20180427095434.14013-4-kraxel@redhat.com> In-Reply-To: <20180427095434.14013-1-kraxel@redhat.com> References: <20180427095434.14013-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Apr 2018 09:54:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Apr 2018 09:54:41 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/6] sdl: Move DisplayOptions global to sdl2_console 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: Markus Armbruster , Alex Williamson , Gerd Hoffmann , Elie Tournier , Paolo Bonzini , Elie Tournier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Elie Tournier Suggested-by: Gerd Hoffmann Signed-off-by: Elie Tournier Message-id: 20180413135842.21325-3-tournier.elie@gmail.com Signed-off-by: Gerd Hoffmann --- include/ui/sdl2.h | 1 + ui/sdl2.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h index 51084e6320..f43eecdbd6 100644 --- a/include/ui/sdl2.h +++ b/include/ui/sdl2.h @@ -14,6 +14,7 @@ struct sdl2_console { DisplayChangeListener dcl; DisplaySurface *surface; + DisplayOptions *opts; SDL_Texture *texture; SDL_Window *real_window; SDL_Renderer *real_renderer; diff --git a/ui/sdl2.c b/ui/sdl2.c index 83b917fa37..da037248c2 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -32,7 +32,6 @@ =20 static int sdl2_num_outputs; static struct sdl2_console *sdl2_console; -static DisplayOptions *opts; =20 static SDL_Surface *guest_sprite_surface; static int gui_grab; /* if true, all keyboard/mouse events are grabbed */ @@ -566,7 +565,7 @@ static void handle_windowevent(SDL_Event *ev) break; case SDL_WINDOWEVENT_CLOSE: if (qemu_console_is_graphic(scon->dcl.con)) { - if (opts->has_window_close && !opts->window_close) { + if (scon->opts->has_window_close && !scon->opts->window_close)= { allow_close =3D false; } if (allow_close) { @@ -613,7 +612,7 @@ void sdl2_poll_events(struct sdl2_console *scon) handle_textinput(ev); break; case SDL_QUIT: - if (opts->has_window_close && !opts->window_close) { + if (scon->opts->has_window_close && !scon->opts->window_close)= { allow_close =3D false; } if (allow_close) { @@ -770,7 +769,6 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) SDL_SysWMinfo info; =20 assert(o->type =3D=3D DISPLAY_TYPE_SDL); - opts =3D o; =20 #ifdef __linux__ /* on Linux, SDL may use fbcon|directfb|svgalib when run without @@ -806,6 +804,7 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) return; } sdl2_console =3D g_new0(struct sdl2_console, sdl2_num_outputs); + sdl2_console->opts =3D o; for (i =3D 0; i < sdl2_num_outputs; i++) { QemuConsole *con =3D qemu_console_lookup_by_index(i); assert(con !=3D NULL); @@ -846,7 +845,8 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) g_free(filename); } =20 - if (opts->has_full_screen && opts->full_screen) { + if (sdl2_console->opts->has_full_screen && + sdl2_console->opts->full_screen) { gui_fullscreen =3D 1; sdl_grab_start(0); } --=20 2.9.3