[Spice-commits] 3 commits - configure.ac src/spice-widget.c src/spice-widget-egl.c tests/session.c tests/util.c
Marc-André Lureau
elmarco at kemper.freedesktop.org
Tue Mar 15 16:16:42 UTC 2016
configure.ac | 6 +++---
src/spice-widget-egl.c | 2 ++
src/spice-widget.c | 12 ++++++++++--
tests/session.c | 4 +---
tests/util.c | 1 +
5 files changed, 17 insertions(+), 8 deletions(-)
New commits:
commit 3c6b4ae867802ca050ed904ad80be8bffe40b1c3
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Tue Mar 15 12:36:33 2016 +0100
build-sys: fix 'Only <spice-client.h> can be included directly' warning
Tests should be allowed to include directly private headers. Set
__SPICE_CLIENT_H_INSIDE__ where necessary or include spice-client.h
where possible.
Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
Acked-by: Fabiano Fidêncio <fidencio at redhat.com>
diff --git a/tests/session.c b/tests/session.c
index feee3db..d065b60 100644
--- a/tests/session.c
+++ b/tests/session.c
@@ -1,6 +1,4 @@
-#include <glib.h>
-
-#include "spice-session.h"
+#include <spice-client.h>
static void test_session_uri(void)
{
diff --git a/tests/util.c b/tests/util.c
index b9b9535..dcc9770 100644
--- a/tests/util.c
+++ b/tests/util.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
+#define __SPICE_CLIENT_H_INSIDE__
#include "spice-util-priv.h"
enum {
commit f9a1aad85fcc76dd76c454b51fbce5e07c9b145f
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Tue Mar 15 11:58:20 2016 +0100
Lower gtk+ requirement to 3.10
Make GtkGlArea optional allows to lower gtk+ requirement to
3.10 (required for GtkStack). However, gl display is unsupported on
wayland with gtk+ < 3.16.
Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
Acked-by: Fabiano Fidêncio <fidencio at redhat.com>
diff --git a/configure.ac b/configure.ac
index 052561a..24fddc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,7 +123,7 @@ AC_ARG_WITH([gtk],
[with_gtk=3.0])
case "$with_gtk" in
- 3.0) GTK_REQUIRED=3.16
+ 3.0) GTK_REQUIRED=3.10
;;
no)
AS_IF([test x$enable_gtk_doc = xyes],
@@ -134,7 +134,7 @@ AC_SUBST([GTK_REQUIRED])
AM_CONDITIONAL([WITH_GTK],[test "$with_gtk" != "no"])
AS_IF([test "x$with_gtk" != "xno"],
- [PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)])
+ [PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED epoxy)])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
SPICE_GTK_REQUIRES="${SPICE_GTK_REQUIRES} gtk+-3.0 >= $GTK_REQUIRED"
diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index 1b3cd07..a9bea52 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -29,7 +29,9 @@
#include <libdrm/drm_fourcc.h>
#include <gdk/gdkx.h>
+#if GTK_CHECK_VERSION(3,16,0)
#include <gdk/gdkwayland.h>
+#endif
#define VERTS_ARRAY_SIZE (sizeof(GLfloat) * 4 * 4)
#define TEX_ARRAY_SIZE (sizeof(GLfloat) * 4 * 2)
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 891f2c8..f86054f 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -539,6 +539,7 @@ static void grab_notify(SpiceDisplay *display, gboolean was_grabbed)
release_keys(display);
}
+#if GTK_CHECK_VERSION(3,16,0)
static gboolean
gl_area_render(GtkGLArea *area, GdkGLContext *context, gpointer user_data)
{
@@ -570,6 +571,7 @@ gl_area_realize(GtkGLArea *area, gpointer user_data)
g_clear_error(&err);
}
}
+#endif
static void
drawing_area_realize(GtkWidget *area, gpointer user_data)
@@ -611,6 +613,7 @@ static void spice_display_init(SpiceDisplay *display)
gtk_widget_set_double_buffered(area, true);
gtk_stack_set_visible_child(GTK_STACK(widget), area);
+#if GTK_CHECK_VERSION(3,16,0)
area = gtk_gl_area_new();
gtk_gl_area_set_required_version(GTK_GL_AREA(area), 3, 2);
gtk_gl_area_set_auto_render(GTK_GL_AREA(area), false);
@@ -620,6 +623,7 @@ static void spice_display_init(SpiceDisplay *display)
NULL);
gtk_stack_add_named(GTK_STACK(widget), area, "gl-area");
gtk_widget_show_all(widget);
+#endif
g_signal_connect(display, "grab-broken-event", G_CALLBACK(grab_broken), NULL);
g_signal_connect(display, "grab-notify", G_CALLBACK(grab_notify), NULL);
@@ -2494,15 +2498,19 @@ static void gl_draw(SpiceDisplay *display,
guint32 x, guint32 y, guint32 w, guint32 h)
{
SpiceDisplayPrivate *d = display->priv;
- GtkWidget *gl = gtk_stack_get_child_by_name(GTK_STACK(display), "gl-area");
SPICE_DEBUG("%s", __FUNCTION__);
set_egl_enabled(display, true);
+#if GTK_CHECK_VERSION(3,16,0)
+ GtkWidget *gl = gtk_stack_get_child_by_name(GTK_STACK(display), "gl-area");
+
if (gtk_stack_get_visible_child(GTK_STACK(display)) == gl) {
gtk_gl_area_queue_render(GTK_GL_AREA(gl));
d->egl.call_draw_done = TRUE;
- } else {
+ } else
+#endif
+ {
spice_egl_update_display(display);
spice_display_gl_draw_done(SPICE_DISPLAY_CHANNEL(d->display));
}
commit 23c8f7d10d8320d95049461dc52161aaabdabccb
Author: Marc-André Lureau <marcandre.lureau at gmail.com>
Date: Tue Mar 15 11:56:57 2016 +0100
build-sys: remove epoxy from pc requires
libepoxy doesn't need to figure in spice-gtk pkg-config requires, it's a
private dependency.
Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
Acked-by: Fabiano Fidêncio <fidencio at redhat.com>
diff --git a/configure.ac b/configure.ac
index 6983b6b..052561a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,7 +137,7 @@ AS_IF([test "x$with_gtk" != "xno"],
[PKG_CHECK_MODULES(GTK, gtk+-3.0 >= $GTK_REQUIRED)])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
-SPICE_GTK_REQUIRES="${SPICE_GTK_REQUIRES} gtk+-3.0 >= $GTK_REQUIRED epoxy"
+SPICE_GTK_REQUIRES="${SPICE_GTK_REQUIRES} gtk+-3.0 >= $GTK_REQUIRED"
PKG_CHECK_EXISTS([gtk+-quartz-$with_gtk], [have_quartz=yes], [have_quartz=no])
AS_IF([test "x$have_quartz" = "xyes"], [AC_DEFINE([HAVE_QUARTZ], 1, [Have Quartz?])])
More information about the Spice-commits
mailing list