Message ID | 20220531202327.14636-2-dongwon.kim@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | handling guest multiple displays | expand |
On Tue, May 31, 2022 at 01:23:26PM -0700, Dongwon Kim wrote: > Detaching any addtional guest displays in case there are multiple > displays assigned to the guest OS (e.g. max_outputs=n) so that > all of them are visible upon lauching. > > Cc: Daniel P. Berrangé <berrange@redhat.com> > Cc: Markus Armbruster <armbru@redhat.com> > Cc: Philippe Mathieu-Daudé <philmd@redhat.com> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Gerd Hoffmann <kraxel@redhat.com> > Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> > Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> > --- > ui/gtk.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> With regards, Daniel
On Tue, May 31, 2022 at 01:23:26PM -0700, Dongwon Kim wrote: > Detaching any addtional guest displays in case there are multiple > displays assigned to the guest OS (e.g. max_outputs=n) so that > all of them are visible upon lauching. > > Cc: Daniel P. Berrangé <berrange@redhat.com> > Cc: Markus Armbruster <armbru@redhat.com> > Cc: Philippe Mathieu-Daudé <philmd@redhat.com> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Gerd Hoffmann <kraxel@redhat.com> > Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> > Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> > --- > ui/gtk.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/ui/gtk.c b/ui/gtk.c > index c57c36749e..abfcf48547 100644 > --- a/ui/gtk.c > +++ b/ui/gtk.c > @@ -2304,6 +2304,8 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) > GtkDisplayState *s = g_malloc0(sizeof(*s)); > GdkDisplay *window_display; > GtkIconTheme *theme; > + int n_gfx_vcs = 0; > + int i; > char *dir; > > if (!gtkinit) { > @@ -2374,7 +2376,14 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) > gtk_widget_set_sensitive(s->copy_item, > vc && vc->type == GD_VC_VTE); > #endif > - > + for (i = 0; i < s->nb_vcs; i++) { > + if (qemu_console_is_graphic(s->vc[i].gfx.dcl.con)) { Accessing vc[i].gfx without checking vc[i].type beforehand is wrong. Also note that graphical consoles are sorted to the head of the list. n_gfx_vcs should not be needed because the primary gfx display has index 0 no matter what. take care, Gerd
diff --git a/ui/gtk.c b/ui/gtk.c index c57c36749e..abfcf48547 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -2304,6 +2304,8 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) GtkDisplayState *s = g_malloc0(sizeof(*s)); GdkDisplay *window_display; GtkIconTheme *theme; + int n_gfx_vcs = 0; + int i; char *dir; if (!gtkinit) { @@ -2374,7 +2376,14 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts) gtk_widget_set_sensitive(s->copy_item, vc && vc->type == GD_VC_VTE); #endif - + for (i = 0; i < s->nb_vcs; i++) { + if (qemu_console_is_graphic(s->vc[i].gfx.dcl.con)) { + if (n_gfx_vcs > 0) { + gtk_menu_item_activate(GTK_MENU_ITEM(s->untabify_item)); + } + n_gfx_vcs++; + } + } if (opts->has_full_screen && opts->full_screen) { gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
Detaching any addtional guest displays in case there are multiple displays assigned to the guest OS (e.g. max_outputs=n) so that all of them are visible upon lauching. Cc: Daniel P. Berrangé <berrange@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> --- ui/gtk.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)