From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzMUy-0002xU-FF for qemu-devel@nongnu.org; Wed, 26 Oct 2016 07:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzMUt-0000JC-Ho for qemu-devel@nongnu.org; Wed, 26 Oct 2016 07:36:00 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:52832) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzMUt-0000Hx-6M for qemu-devel@nongnu.org; Wed, 26 Oct 2016 07:35:55 -0400 Date: Wed, 26 Oct 2016 13:35:52 +0200 From: Samuel Thibault Message-ID: <20161026113552.GA2811@var.bordeaux.inria.fr> References: <20161023195433.20102-1-samuel.thibault@ens-lyon.org> <20161023195433.20102-4-samuel.thibault@ens-lyon.org> <1477477064.18984.39.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477477064.18984.39.camel@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/3] Move getting XWindow ID from baum driver to graphical backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org 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