[Spice-commits] 3 commits - m4/spice-compile-warnings.m4 src/Makefile.am src/controller src/spice-widget.c

Christophe Fergau teuf at kemper.freedesktop.org
Thu Dec 8 15:29:45 UTC 2016


 m4/spice-compile-warnings.m4 |    2 +-
 src/Makefile.am              |    2 ++
 src/controller/Makefile.am   |    2 ++
 src/spice-widget.c           |   27 ++++++++++++++++++++++++++-
 4 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit e65be108392ba86a42b75dfcf2789fd398ec6b53
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Dec 8 16:17:09 2016 +0100

    spicy: Disable deprecation warnings
    
    It still uses GtkUIManager and GtkAction
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Francois Gouget <fgouget at codeweavers.com>

diff --git a/src/Makefile.am b/src/Makefile.am
index 3f81866..78b215f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -402,10 +402,12 @@ spicy_LDADD =						\
 	$(LIBM)						\
 	$(NULL)
 
+# FIXME: GtkAction and lots of GtkUIManager APIs are deprecated
 spicy_CPPFLAGS =			\
 	$(AM_CPPFLAGS)			\
 	$(GTHREAD_CFLAGS)		\
 	-DSPICE_DISABLE_DEPRECATED	\
+	-Wno-deprecated-declarations	\
 	$(NULL)
 
 
commit f8e0516ba7f6dcc8b27e02e80fd6f3d23a03e816
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Nov 23 07:09:28 2016 +0100

    build-sys: Enable deprecation warnings instead of ignoring them entirely
    
    For Spice-gtk most deprecation issues come from changes outside Spice
    (GLib) and thus should not be treated as errors to not break
    compilation for users who have newer third-party libraries.
    However they must be visible otherwise Spice developers will not be
    aware of them and thus will not fix them before breakage happens.
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4
index 533bac6..dfa88fe 100644
--- a/m4/spice-compile-warnings.m4
+++ b/m4/spice-compile-warnings.m4
@@ -85,7 +85,7 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
     gl_WARN_ADD([-Wno-format-nonliteral])
     # We use some deprecated functions to avoid #ifdef hell while maintaining
     # compat with older gtk / glib versions
-    gl_WARN_ADD([-Wno-deprecated-declarations])
+    gl_WARN_ADD([-Wno-error=deprecated-declarations])
 
 
 
diff --git a/src/controller/Makefile.am b/src/controller/Makefile.am
index fb56986..c68373c 100644
--- a/src/controller/Makefile.am
+++ b/src/controller/Makefile.am
@@ -1,5 +1,7 @@
 NULL =
 
+# FIXME: We need to disable the deprecation warnings until valac stops
+#        generating code that uses the deprecated GSimpleAsyncResult class.
 AM_CPPFLAGS =					\
 	-DG_LOG_DOMAIN=\"GSpiceController\"	\
 	$(GIO_CFLAGS)				\
commit a5804643d69b70de8f84309e7eb929a485b732c8
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Dec 1 05:11:52 2016 +0100

    gtk: Temporarily ignore the keyboard/mouse grabbing deprecation warnings
    
    Note that the *_IGNORE_DEPRECATIONS macros are treated as separate
    statements by the compiler so they need to be put in a proper code block
    where appropriate.
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/src/spice-widget.c b/src/spice-widget.c
index 82adacf..72fbbc8 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -812,6 +812,9 @@ SpiceGrabSequence *spice_display_get_grab_keys(SpiceDisplay *display)
     return d->grabseq;
 }
 
+/* FIXME: gdk_keyboard_grab/ungrab() is deprecated */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 static void try_keyboard_grab(SpiceDisplay *display)
 {
     GtkWidget *widget = GTK_WIDGET(display);
@@ -878,6 +881,8 @@ static void try_keyboard_ungrab(SpiceDisplay *display)
     d->keyboard_grab_active = false;
     g_signal_emit(widget, signals[SPICE_DISPLAY_KEYBOARD_GRAB], 0, false);
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
+
 
 static void update_keyboard_grab(SpiceDisplay *display)
 {
@@ -1002,6 +1007,8 @@ static gboolean do_pointer_grab(SpiceDisplay *display)
      * what window the pointer is actally over, so use 'FALSE' for
      * 'owner_events' parameter
      */
+    /* FIXME: gdk_pointer_grab() is deprecated */
+    G_GNUC_BEGIN_IGNORE_DEPRECATIONS
     status = gdk_pointer_grab(window, FALSE,
                      GDK_POINTER_MOTION_MASK |
                      GDK_BUTTON_PRESS_MASK |
@@ -1011,6 +1018,7 @@ static gboolean do_pointer_grab(SpiceDisplay *display)
                      NULL,
                      blank,
                      GDK_CURRENT_TIME);
+    G_GNUC_END_IGNORE_DEPRECATIONS
     grab_successful = (status == GDK_GRAB_SUCCESS);
     if (!grab_successful) {
         d->mouse_grab_active = false;
@@ -1101,8 +1109,11 @@ static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion)
         /* FIXME: we try our best to ignore that next pointer move event.. */
         gdk_display_sync(gdk_screen_get_display(screen));
 
+        /* FIXME: gdk_display_warp_pointer() is deprecated */
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         gdk_display_warp_pointer(gtk_widget_get_display(GTK_WIDGET(display)),
                                  screen, xr, yr);
+        G_GNUC_END_IGNORE_DEPRECATIONS
         d->mouse_last_x = -1;
         d->mouse_last_y = -1;
     }
@@ -1110,6 +1121,9 @@ static void mouse_wrap(SpiceDisplay *display, GdkEventMotion *motion)
 
 }
 
+/* FIXME: gdk_pointer_ungrab()/gdk_display_warp_pointer() are deprecated */
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 static void try_mouse_ungrab(SpiceDisplay *display)
 {
     SpiceDisplayPrivate *d = display->priv;
@@ -1142,6 +1156,7 @@ static void try_mouse_ungrab(SpiceDisplay *display)
     g_signal_emit(display, signals[SPICE_DISPLAY_MOUSE_GRAB], 0, false);
     spice_gtk_session_set_pointer_grabbed(d->gtk_session, false);
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 
 static void update_mouse_grab(SpiceDisplay *display)
 {
@@ -1972,7 +1987,7 @@ static gboolean button_event(GtkWidget *widget, GdkEventButton *button)
             try_mouse_grab(display);
             return true;
         }
-    } else
+    } else {
         /* allow to drag and drop between windows/displays:
 
            By default, X (and other window system) do a pointer grab
@@ -1985,7 +2000,11 @@ static gboolean button_event(GtkWidget *widget, GdkEventButton *button)
            FIXME: should be multiple widget grab, but how?
            or should know the position of the other widgets?
         */
+        /* FIXME: gdk_pointer_ungrab() is deprecated */
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         gdk_pointer_ungrab(GDK_CURRENT_TIME);
+        G_GNUC_END_IGNORE_DEPRECATIONS
+    }
 
     if (!d->inputs)
         return true;
@@ -2355,7 +2374,10 @@ static void update_mouse_mode(SpiceChannel *channel, gpointer data)
 
         if (window != NULL) {
             GdkModifierType modifiers;
+            /* FIXME: gdk_window_get_pointer() is deprecated */
+            G_GNUC_BEGIN_IGNORE_DEPRECATIONS
             gdk_window_get_pointer(window, NULL, NULL, &modifiers);
+            G_GNUC_END_IGNORE_DEPRECATIONS
 
             if (modifiers & SPICE_GDK_BUTTONS_MASK)
                 try_mouse_grab(display);
@@ -2771,7 +2793,10 @@ static void gl_draw(SpiceDisplay *display,
     GtkWidget *gl = gtk_stack_get_child_by_name(d->stack, "gl-area");
 
     if (gtk_stack_get_visible_child(d->stack) == gl) {
+        /* Ignore GLib's too-new warnings */
+        G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         gtk_gl_area_queue_render(GTK_GL_AREA(gl));
+        G_GNUC_END_IGNORE_DEPRECATIONS
         d->egl.call_draw_done = TRUE;
     } else
 #endif


More information about the Spice-commits mailing list