qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] fix gtk interface for vfio + vga=none (was: Mousegr


From: Benedikt Morbach
Subject: [Qemu-devel] [PATCH] fix gtk interface for vfio + vga=none (was: Mousegrab broken with vfio in 2.1.0)
Date: Wed, 13 Aug 2014 03:19:06 +0200

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]