[Spice-devel] [client v3 03/10] gtk: Ignore GLib's too-new warnings where we explicitly check its version

Francois Gouget fgouget at codeweavers.com
Thu Oct 27 16:41:28 UTC 2016


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 src/spice-gtk-session.c | 3 +++
 src/spice-widget-egl.c  | 3 +++
 src/spice-widget.c      | 6 ++++++
 3 files changed, 12 insertions(+)

diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 3e0ec74..7bed005 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -126,6 +126,8 @@ static guint32 get_keyboard_lock_modifiers(void)
 {
     guint32 modifiers = 0;
 #if GTK_CHECK_VERSION(3,18,0)
+/* Ignore GLib's too-new warnings */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     GdkKeymap *keyboard = gdk_keymap_get_default();
 
     if (gdk_keymap_get_caps_lock_state(keyboard)) {
@@ -139,6 +141,7 @@ static guint32 get_keyboard_lock_modifiers(void)
     if (gdk_keymap_get_scroll_lock_state(keyboard)) {
         modifiers |= SPICE_INPUTS_SCROLL_LOCK;
     }
+G_GNUC_END_IGNORE_DEPRECATIONS
 #else
 #ifdef HAVE_X11_XKBLIB_H
     Display *x_display = NULL;
diff --git a/src/spice-widget-egl.c b/src/spice-widget-egl.c
index 0698af3..3cc1098 100644
--- a/src/spice-widget-egl.c
+++ b/src/spice-widget-egl.c
@@ -303,9 +303,12 @@ gl_make_current(SpiceDisplay *display, GError **err)
     }
 #if GTK_CHECK_VERSION(3,16,0)
     else {
+        /* Ignore GLib's too-new warnings */
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         GtkWidget *area = gtk_stack_get_child_by_name(d->stack, "gl-area");
 
         gtk_gl_area_make_current(GTK_GL_AREA(area));
+        G_GNUC_END_IGNORE_DEPRECATIONS
     }
 #endif
 
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 3ac0a7d..82adacf 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -567,6 +567,8 @@ static void grab_notify(SpiceDisplay *display, gboolean was_grabbed)
 
 #if GTK_CHECK_VERSION(3,16,0)
 #ifndef G_OS_WIN32
+/* Ignore GLib's too-new warnings */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 static gboolean
 gl_area_render(GtkGLArea *area, GdkGLContext *context, gpointer user_data)
 {
@@ -598,6 +600,7 @@ gl_area_realize(GtkGLArea *area, gpointer user_data)
         g_clear_error(&err);
     }
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 #endif
 #endif
 
@@ -636,6 +639,8 @@ static void spice_display_init(SpiceDisplay *display)
 
 #if GTK_CHECK_VERSION(3,16,0)
 #ifndef G_OS_WIN32
+/* Ignore GLib's too-new warnings */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     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);
@@ -645,6 +650,7 @@ static void spice_display_init(SpiceDisplay *display)
                      NULL);
     gtk_stack_add_named(d->stack, area, "gl-area");
     gtk_widget_show_all(widget);
+G_GNUC_END_IGNORE_DEPRECATIONS
 #endif
 #endif
 
-- 
2.9.3



More information about the Spice-devel mailing list