qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/4] gtk: use GtkGlArea on wayland only
Date: Mon, 23 Oct 2017 14:03:16 +0200	[thread overview]
Message-ID: <20171023120317.8296-4-kraxel@redhat.com> (raw)
In-Reply-To: <20171023120317.8296-1-kraxel@redhat.com>

For dma-buf imports we need a egl context.  The GtkGlArea widget uses
glx though when running on X11.  So use the GtkGlArea code on wayland
only.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/gtk.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 33cd848db3..d794fb7fa9 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2374,12 +2374,15 @@ void early_gtk_display_init(int opengl)
         break;
     case 1: /* on */
 #if defined(CONFIG_OPENGL)
-#if defined(CONFIG_GTK_GL)
-        gtk_use_gl_area = true;
-        gtk_gl_area_init();
-#else
-        gtk_egl_init();
+#if defined(CONFIG_GTK_GL) && defined(GDK_WINDOWING_WAYLAND)
+        if (GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
+            gtk_use_gl_area = true;
+            gtk_gl_area_init();
+        }
 #endif
+        {
+            gtk_egl_init();
+        }
 #endif
         break;
     default:
-- 
2.9.3

  parent reply	other threads:[~2017-10-23 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 12:03 [Qemu-devel] [PATCH 0/4] gtk: add dmabuf support Gerd Hoffmann
2017-10-23 12:03 ` [Qemu-devel] [PATCH 1/4] opengl: split up dpy_gl_cursor ops Gerd Hoffmann
2017-10-23 12:03 ` [Qemu-devel] [PATCH 2/4] gtk: make GtkGlArea usage a runtime option Gerd Hoffmann
2017-10-23 12:03 ` Gerd Hoffmann [this message]
2017-10-23 12:03 ` [Qemu-devel] [PATCH 4/4] gtk-egl: add dmabuf support 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=20171023120317.8296-4-kraxel@redhat.com \
    --to=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).