Hello, Gerd Hoffmann, on Wed 26 Oct 2016 12:17:44 +0200, wrote: > On So, 2016-10-23 at 21:54 +0200, Samuel Thibault wrote: > > This adds two console functions, qemu_console_set_window_id and > > qemu_graphic_console_get_window_id, to let graphical backend record the > > window id in the QemuConsole structure, and let the baum driver read it. > > > > We can then move the SDL code from the baum driver to the sdl ui code, > > and add SDL2 and Gtk versions of the code. > > Patches 1+2 look good to me, but I don't feel like rushing this one > before the freeze.
Ok, it'd be nice to have 1+2 in in the next release already indeed, they are needed fixes. 3 can be applied later, for the time being people can use sdl1.2. > Also splitting this up would be nice. You mean separating the move of the sdl1.2 code from the addition of sdl2+gtk code? (and perhaps separate sdl2 and gtk?) > > +int qemu_graphic_console_get_window_id(void) > > +{ > > + int i; > > + for (i = 0; i < nb_consoles; i++) { > > + if (consoles[i]->console_type == GRAPHIC_CONSOLE) { > > + return consoles[i]->window_id; > > + } > > + } > > + return -1; > > +} > > No loop needed here. qemu sorts consoles so the graphic ones come > first. Ok, but are we sure nobody will change that assumption someday? Or do we assume that if somebody changes it he will notice the assumption in qemu_graphic_console_get_window_id? > > + gdk_window = gtk_widget_get_window(s->window); > > +#ifdef GDK_WINDOWING_X11 > > + window_id = GDK_WINDOW_XID(gdk_window); > > +#elif defined(GDK_WINDOWING_WIN32) > > + window_id = gdk_win32_window_get_impl_hwnd(gdk_window); > > +#endif > > + for (i = 0; ; i++) { > > + /* All consoles share the same window */ > > No. That is the default setup, but try "View / Detach tab". Window ID > changing at runtime ... Ah. That'll have to be reworked then indeed. Samuel