From patchwork Thu Jan 12 17:05:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 714556 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tzt4R6w43z9sCX for ; Fri, 13 Jan 2017 04:27:35 +1100 (AEDT) Received: from localhost ([::1]:35487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRj9x-0000m3-Hu for incoming@patchwork.ozlabs.org; Thu, 12 Jan 2017 12:27:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRiou-0003rC-B2 for qemu-devel@nongnu.org; Thu, 12 Jan 2017 12:05:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRiop-0003S7-O8 for qemu-devel@nongnu.org; Thu, 12 Jan 2017 12:05:48 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:60191) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRiop-0003Qv-61 for qemu-devel@nongnu.org; Thu, 12 Jan 2017 12:05:43 -0500 X-IronPort-AV: E=Sophos;i="5.33,219,1477954800"; d="scan'208";a="255067189" Received: from unknown (HELO var.youpi.perso.aquilenet.fr) ([193.50.110.164]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 12 Jan 2017 18:05:39 +0100 Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.88) (envelope-from ) id 1cRiol-0007Sh-GU; Thu, 12 Jan 2017 18:05:39 +0100 Date: Thu, 12 Jan 2017 18:05:39 +0100 From: Samuel Thibault To: Gerd Hoffmann Message-ID: <20170112170539.GS2832@var.bordeaux.inria.fr> References: <1483967385-12891-1-git-send-email-kraxel@redhat.com> <1483967385-12891-6-git-send-email-kraxel@redhat.com> <1484236609.5151.16.camel@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1484236609.5151.16.camel@redhat.com> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.83 Subject: Re: [Qemu-devel] [PULL v2 05/11] sdl2: set window ID 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: Stefan Weil , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hello, Gerd Hoffmann, on Thu 12 Jan 2017 16:56:49 +0100, wrote: > On Do, 2017-01-12 at 16:10 +0100, Stefan Weil wrote: > > This commit breaks builds for Windows. See below for details. > > > Windows does not use X11. gcc fails: > > > > CC ui/sdl2.o > > /qemu/ui/sdl2.c: In function ‘sdl_display_init’: > > /qemu/ui/sdl2.c:821:54: error: ‘union ’ has no member named ‘x11’ > > qemu_console_set_window_id(con, info.info.x11.window); > > Oops. Oops, sorry, it seems to have been overlooked indeed. Can you easily test the attached patch? Samuel diff --git a/ui/sdl2.c b/ui/sdl2.c index 9a79b17b92..0f41d1fa90 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -762,6 +762,9 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) char *filename; int i; SDL_SysWMinfo info; +#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11) + int window_id; +#endif if (no_frame) { gui_noframe = 1; @@ -817,9 +820,17 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) sdl2_console[i].dcl.con = con; register_displaychangelistener(&sdl2_console[i].dcl); +#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11) if (SDL_GetWindowWMInfo(sdl2_console[i].real_window, &info)) { - qemu_console_set_window_id(con, info.info.x11.window); +#ifdef SDL_VIDEO_DRIVER_WINDOWS + window_id = (int)(uintptr_t) info.info.win.hwnd; +#endif +#ifdef SDL_VIDEO_DRIVER_X11 + window_id = info.info.x11.window; +#endif + qemu_console_set_window_id(con, window_id); } +#endif } /* Load a 32x32x4 image. White pixels are transparent. */