qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Benedikt Morbach <benedikt.morbach@googlemail.com>
To: qemu-devel@nongnu.org
Cc: kraxel@redhat.com
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	[thread overview]
Message-ID: <1407892746.4116.0.camel@googlemail.com> (raw)
In-Reply-To: <1407448703.22670.1.camel@googlemail.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

  reply	other threads:[~2014-08-13  1:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-06 22:22 [Qemu-devel] Mousegrab broken with vfio in 2.1.0 (was: [PATCH 00/25] qemu gtk ui overhaul) Benedikt Morbach
2014-08-07 21:58 ` Benedikt Morbach
2014-08-13  1:19   ` Benedikt Morbach [this message]
2014-08-25 13:51 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407892746.4116.0.camel@googlemail.com \
    --to=benedikt.morbach@googlemail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).