qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL v2 05/11] sdl2: set window ID


From: Stefan Weil
Subject: Re: [Qemu-devel] [PULL v2 05/11] sdl2: set window ID
Date: Thu, 12 Jan 2017 20:07:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1

On 01/12/17 18:05, Samuel Thibault wrote:
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 <anonymous>’ 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


It does not compile. I fixed it and simplified the code a little bit
(see below, please fix line wrap which my mailer enforced). That code
compiles. I did not run tests.

Stefan


diff --git a/ui/sdl2.c b/ui/sdl2.c
index 9a79b17b92..91fb111aa5 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -817,9 +817,15 @@ 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)) {
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
+ qemu_console_set_window_id(con, (uintptr_t)info.info.win.window);
+#elif defined(SDL_VIDEO_DRIVER_X11)
             qemu_console_set_window_id(con, info.info.x11.window);
+#endif
         }
+#endif
     }

     /* Load a 32x32x4 image. White pixels are transparent. */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]