[Spice-commits] 2 commits - src/spice-gtk-session.c src/spice-widget.c src/spice-widget-egl.c
Pavel Grunt
pgrunt at kemper.freedesktop.org
Tue Jun 20 10:20:25 UTC 2017
src/spice-gtk-session.c | 2 +-
src/spice-widget-egl.c | 14 +++++++++++++-
src/spice-widget.c | 5 +++--
3 files changed, 17 insertions(+), 4 deletions(-)
New commits:
commit 008eae8879d2bc045cd41a4b32ff5a2c321398f9
Author: Pavel Grunt <pgrunt at redhat.com>
Date: Mon Jun 19 16:32:57 2017 +0200
Unrealize egl display only if it has context
Avoids a critical to be logged when closing remote-viewer:
"gl_make_current: assertion 'd->egl.context_ready' failed"
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 139510d..c335083 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -2161,7 +2161,8 @@ static void unrealize(GtkWidget *widget)
{
spice_cairo_image_destroy(SPICE_DISPLAY(widget));
#if HAVE_EGL
- spice_egl_unrealize_display(SPICE_DISPLAY(widget));
+ if (SPICE_DISPLAY(widget)->priv->egl.context_ready)
+ spice_egl_unrealize_display(SPICE_DISPLAY(widget));
#endif
GTK_WIDGET_CLASS(spice_display_parent_class)->unrealize(widget);
commit a7381b0864b7e6b15e6d08f68e53bf3a429ab4ed
Author: Pavel Grunt <pgrunt at redhat.com>
Date: Mon Jun 19 15:59:41 2017 +0200
Allow to build without X11 gdk backend
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 33db3c8..e338ce6 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -18,10 +18,10 @@
#include "config.h"
#include <glib.h>
+#include <gdk/gdk.h>
#ifdef HAVE_X11_XKBLIB_H
#include <X11/XKBlib.h>
-#include <gdk/gdkx.h>
#endif
#ifdef GDK_WINDOWING_X11
#include <X11/Xlib.h>
diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index 7c21113..b50641c 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -18,6 +18,7 @@
#include "config.h"
#include <math.h>
+#include <gdk/gdk.h>
#define EGL_EGLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
@@ -27,7 +28,9 @@
#include "spice-gtk-session-priv.h"
#include <libdrm/drm_fourcc.h>
+#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
+#endif
#ifdef GDK_WINDOWING_WAYLAND
#include <gdk/gdkwayland.h>
#endif
@@ -291,6 +294,7 @@ gl_make_current(SpiceDisplay *display, GError **err)
g_return_val_if_fail(d->egl.context_ready, FALSE);
+#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
EGLBoolean success = eglMakeCurrent(d->egl.display,
d->egl.surface,
@@ -303,8 +307,12 @@ gl_make_current(SpiceDisplay *display, GError **err)
return FALSE;
}
}
+#endif
#if GTK_CHECK_VERSION(3,16,0)
- else {
+#ifdef GDK_WINDOWING_X11
+ else
+#endif
+ {
/* Ignore GLib's too-new warnings */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GtkWidget *area = gtk_stack_get_child_by_name(d->stack, "gl-area");
@@ -402,6 +410,7 @@ void spice_egl_unrealize_display(SpiceDisplay *display)
d->egl.prog = 0;
}
+#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
/* egl.surface && egl.ctx are only created on x11, see
spice_egl_init() */
@@ -422,6 +431,7 @@ void spice_egl_unrealize_display(SpiceDisplay *display)
/* do not call eglterminate() since egl may be used by
* somebody else code */
}
+#endif
}
G_GNUC_INTERNAL
@@ -619,10 +629,12 @@ void spice_egl_update_display(SpiceDisplay *display)
0, 0, 1, 1);
}
+#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
/* gtk+ does the swap with gtkglarea */
eglSwapBuffers(d->egl.display, d->egl.surface);
}
+#endif
glUseProgram(prog);
}
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 386724d..139510d 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -19,10 +19,10 @@
#include <math.h>
#include <glib.h>
+#include <gdk/gdk.h>
#ifdef HAVE_X11_XKBLIB_H
#include <X11/XKBlib.h>
-#include <gdk/gdkx.h>
#endif
#ifdef GDK_WINDOWING_X11
#include <X11/Xlib.h>
More information about the Spice-commits
mailing list