From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIIha-0001ml-N2 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:05:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIIhV-0000bW-M3 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:05:10 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:57026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIIhV-0000UU-3t for qemu-devel@nongnu.org; Wed, 20 Mar 2013 09:05:05 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Mar 2013 22:56:53 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id EFFE92BB0050 for ; Thu, 21 Mar 2013 00:04:55 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2KCq21M10092988 for ; Wed, 20 Mar 2013 23:52:02 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2KD4t1b019403 for ; Thu, 21 Mar 2013 00:04:55 +1100 From: Anthony Liguori In-Reply-To: <1363772625-9182-23-git-send-email-kraxel@redhat.com> References: <1363772625-9182-1-git-send-email-kraxel@redhat.com> <1363772625-9182-23-git-send-email-kraxel@redhat.com> Date: Wed, 20 Mar 2013 08:04:32 -0500 Message-ID: <87d2uu6x3z.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 22/23] gtk: show a window for each graphical QemuConsole List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Gerd Hoffmann writes: > Multihead support: For each graphical console we'll create a gtk > window, so with multiple graphics cards installed you get a gtk window > for each. vte tabs are attached to the console #0 window. This is neat but I'm not sure if the user experience is right. Each window would have independent grab. Each window would have independent full screen. I'm not sure there's an obviously right solution but it's worth discussing. I do like the idea of having two windows but perhaps we should make the second window have a no menu bar with a title that indicates that it's a secondary display? Regards, Anthony Liguori > --- > ui/gtk.c | 40 +++++++++++++++++++++++++++------------- > 1 file changed, 27 insertions(+), 13 deletions(-) > > diff --git a/ui/gtk.c b/ui/gtk.c > index 512e974..1c86054 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -159,8 +159,6 @@ typedef struct GtkDisplayState > bool external_pause_update; > } GtkDisplayState; > > -static GtkDisplayState *global_state; > - > /** Utility Functions **/ > > static bool gd_is_grab_active(GtkDisplayState *s) > @@ -1210,7 +1208,7 @@ static void gd_connect_signals(GtkDisplayState *s) > G_CALLBACK(gd_leave_event), s); > } > > -static void gd_create_menus(GtkDisplayState *s) > +static void gd_create_menus(GtkDisplayState *s, bool vtetabs) > { > GtkStockItem item; > GtkAccelGroup *accel_group; > @@ -1302,11 +1300,13 @@ static void gd_create_menus(GtkDisplayState *s) > gtk_accel_map_add_entry("/View/VGA", GDK_KEY_1, GDK_CONTROL_MASK | GDK_MOD1_MASK); > gtk_menu_shell_append(GTK_MENU_SHELL(s->view_menu), s->vga_item); > > - for (i = 0; i < nb_vcs; i++) { > - VirtualConsole *vc = &s->vc[i]; > + if (vtetabs) { > + for (i = 0; i < nb_vcs; i++) { > + VirtualConsole *vc = &s->vc[i]; > > - group = gd_vc_init(s, vc, i, group); > - s->nb_vcs++; > + group = gd_vc_init(s, vc, i, group); > + s->nb_vcs++; > + } > } > > separator = gtk_separator_menu_item_new(); > @@ -1336,14 +1336,13 @@ static const DisplayChangeListenerOps dcl_ops = { > .dpy_cursor_define = gd_cursor_define, > }; > > -void gtk_display_init(DisplayState *ds) > +static void gtk_display_init_one(DisplayState *ds, QemuConsole *con, > + bool vtetabs) > { > GtkDisplayState *s = g_malloc0(sizeof(*s)); > > - gtk_init(NULL, NULL); > - > s->dcl.ops = &dcl_ops; > - s->dcl.con = qemu_console_lookup_by_index(0); > + s->dcl.con = con; > > s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); > #if GTK_CHECK_VERSION(3, 2, 0) > @@ -1371,7 +1370,7 @@ void gtk_display_init(DisplayState *ds) > > gtk_notebook_append_page(GTK_NOTEBOOK(s->notebook), s->drawing_area, gtk_label_new("VGA")); > > - gd_create_menus(s); > + gd_create_menus(s, vtetabs); > > gd_connect_signals(s); > > @@ -1400,6 +1399,21 @@ void gtk_display_init(DisplayState *ds) > gtk_widget_show_all(s->window); > > register_displaychangelistener(ds, &s->dcl); > +} > > - global_state = s; > +void gtk_display_init(DisplayState *ds) > +{ > + QemuConsole *con; > + int i = 0; > + > + gtk_init(NULL, NULL); > + > + con = qemu_console_lookup_by_index(i++); > + gtk_display_init_one(ds, con, true); > + while ((con = qemu_console_lookup_by_index(i++)) != NULL) { > + if (!qemu_console_is_graphic(con)) { > + break; > + } > + gtk_display_init_one(ds, con, false); > + } > } > -- > 1.7.9.7