From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHNDi-0005HM-AC for qemu-devel@nongnu.org; Tue, 12 Aug 2014 21:19:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHNDc-0002oy-RD for qemu-devel@nongnu.org; Tue, 12 Aug 2014 21:19:18 -0400 Received: from mail-wg0-x22a.google.com ([2a00:1450:400c:c00::22a]:56477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHNDc-0002oh-JS for qemu-devel@nongnu.org; Tue, 12 Aug 2014 21:19:12 -0400 Received: by mail-wg0-f42.google.com with SMTP id l18so10544957wgh.1 for ; Tue, 12 Aug 2014 18:19:11 -0700 (PDT) Message-ID: <1407892746.4116.0.camel@googlemail.com> From: Benedikt Morbach Date: Wed, 13 Aug 2014 03:19:06 +0200 In-Reply-To: <1407448703.22670.1.camel@googlemail.com> References: <1407363732.4938.2.camel@googlemail.com> <1407448703.22670.1.camel@googlemail.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] fix gtk interface for vfio + vga=none (was: Mousegrab broken with vfio in 2.1.0) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com after the recent ui rework it didn't show a gfx window if no emulated graphics card was attached. This prevented input grab from working for the vfio gpu passthrough use case. Hack around this by always creating at least one gfx tab. --- I'm not quite sure how much of a hack this is, but it at least matches the old behaviour of creating at least one gfx console and works for me. So if anyone wants to give this a shot until someone comes up with a proper fix, here it is. ui/gtk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index 2345d7e..4251fd3 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1639,9 +1639,11 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, Error *local_err = NULL; Object *obj; - obj = object_property_get_link(OBJECT(con), "device", &local_err); - if (obj) { - vc->label = g_strdup_printf("%s", object_get_typename(obj)); + if (con) { + obj = object_property_get_link(OBJECT(con), "device", &local_err); + if (obj) { + vc->label = g_strdup_printf("%s", object_get_typename(obj)); + } } else { vc->label = g_strdup_printf("VGA"); } @@ -1742,7 +1744,7 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s, GtkAccelGroup *accel_g /* gfx */ for (vc = 0;; vc++) { con = qemu_console_lookup_by_index(vc); - if (!con || !qemu_console_is_graphic(con)) { + if (vc > 0 && (!con || !qemu_console_is_graphic(con))) { break; } group = gd_vc_gfx_init(s, &s->vc[vc], con, -- 2.0.4