[Spice-commits] 7 commits - src/Makefile.am src/spice-audio.h src/spice-audio-priv.h src/spice-channel.h src/spice-gtk-session.c src/spice-session.c src/spice-util.h src/spice-widget.c src/spice-widget-egl.c src/usb-device-manager.h src/vncdisplaykeymap.c
Victor Toso de Carvalho
victortoso at kemper.freedesktop.org
Mon Oct 31 16:14:30 UTC 2016
src/Makefile.am | 1 -
src/spice-audio-priv.h | 2 ++
src/spice-audio.h | 5 -----
src/spice-channel.h | 5 +++--
src/spice-gtk-session.c | 11 +++++++++--
src/spice-session.c | 2 +-
src/spice-util.h | 14 +++-----------
src/spice-widget-egl.c | 3 +++
src/spice-widget.c | 7 ++++++-
src/usb-device-manager.h | 2 +-
src/vncdisplaykeymap.c | 27 +--------------------------
11 files changed, 29 insertions(+), 50 deletions(-)
New commits:
commit a60abf75ac409786045cfc67982821add6a6d3b7
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Oct 27 18:42:00 2016 +0200
build-sys: Use spice-protocol's deprecation macros
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/src/spice-channel.h b/src/spice-channel.h
index 3b0bffb..aa0d9cb 100644
--- a/src/spice-channel.h
+++ b/src/spice-channel.h
@@ -24,6 +24,7 @@
#include <gio/gio.h>
+#include <spice/macros.h>
#include "spice-types.h"
#include "spice-glib-enums.h"
#include "spice-util.h"
@@ -136,9 +137,9 @@ gboolean spice_channel_test_common_capability(SpiceChannel *channel, guint32 cap
void spice_channel_flush_async(SpiceChannel *channel, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
gboolean spice_channel_flush_finish(SpiceChannel *channel, GAsyncResult *result, GError **error);
#ifndef SPICE_DISABLE_DEPRECATED
-SPICE_DEPRECATED
+SPICE_GNUC_DEPRECATED
void spice_channel_set_capability(SpiceChannel *channel, guint32 cap);
-SPICE_DEPRECATED
+SPICE_GNUC_DEPRECATED
void spice_channel_destroy(SpiceChannel *channel);
#endif
diff --git a/src/spice-util.h b/src/spice-util.h
index a01da0c..a2a7683 100644
--- a/src/spice-util.h
+++ b/src/spice-util.h
@@ -50,8 +50,6 @@ gchar* spice_uuid_to_string(const guint8 uuid[16]);
#endif /* __GNUC__ */
#endif
-#define SPICE_DEPRECATED G_GNUC_DEPRECATED
-
G_END_DECLS
#endif /* SPICE_UTIL_H */
diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h
index 6a8d0ac..219fe44 100644
--- a/src/usb-device-manager.h
+++ b/src/usb-device-manager.h
@@ -131,7 +131,7 @@ gboolean spice_usb_device_manager_disconnect_device_finish(
SpiceUsbDeviceManager *self, GAsyncResult *res, GError **err);
#ifndef SPICE_DISABLE_DEPRECATED
-SPICE_DEPRECATED
+SPICE_GNUC_DEPRECATED
void spice_usb_device_manager_disconnect_device(SpiceUsbDeviceManager *manager,
SpiceUsbDevice *device);
#endif
commit 02431db1f525b614cea9f572b01ba0200a2fd0c3
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Oct 28 11:39:09 2016 +0200
build-sys: Remove SPICE_NO_DEPRECATED
The new policy is that deprecation warnings should not be disabled
globally or even per-file with SPICE_NO_DEPRECATED. Instead they should
either be fixed, or ignored locally with
G_GNUC_{BEGIN,END}_IGNORE_DEPRECATIONS.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index 78953dd..3f81866 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -77,7 +77,6 @@ KEYMAP_GEN = $(srcdir)/keymap-gen.pl
SPICE_COMMON_CPPFLAGS = \
-DSPICE_COMPILATION \
-DG_LOG_DOMAIN=\"GSpice\" \
- -DSPICE_NO_DEPRECATED \
-DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\" \
-DPNP_IDS=\""$(PNP_IDS)"\" \
-DUSB_IDS=\""$(USB_IDS)"\" \
diff --git a/src/spice-util.h b/src/spice-util.h
index 88e3a57..a01da0c 100644
--- a/src/spice-util.h
+++ b/src/spice-util.h
@@ -41,22 +41,16 @@ gchar* spice_uuid_to_string(const guint8 uuid[16]);
#define SPICE_RESERVED_PADDING (10 * sizeof(void*))
/* need to be in a public header */
-#ifndef SPICE_GNUC_DEPRECATED_FOR
+#ifndef SPICE_DEPRECATED_FOR
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define SPICE_GNUC_DEPRECATED_FOR(f) \
+#define SPICE_DEPRECATED_FOR(f) \
__attribute__((deprecated("Use " #f " instead")))
#else
-#define SPICE_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED
+#define SPICE_DEPRECATED_FOR(f) G_GNUC_DEPRECATED
#endif /* __GNUC__ */
#endif
-#ifndef SPICE_NO_DEPRECATED
-#define SPICE_DEPRECATED_FOR(f) SPICE_GNUC_DEPRECATED_FOR(f)
#define SPICE_DEPRECATED G_GNUC_DEPRECATED
-#else
-#define SPICE_DEPRECATED_FOR(f)
-#define SPICE_DEPRECATED
-#endif
G_END_DECLS
commit c6d9fa1c4af03d9875bf503ce6eabc9e7b52acc3
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Oct 27 18:41:48 2016 +0200
audio: Remove spice_audio_new() from the public header
It has been deprecated for long enough.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/src/spice-audio-priv.h b/src/spice-audio-priv.h
index f108059..8eee89b 100644
--- a/src/spice-audio-priv.h
+++ b/src/spice-audio-priv.h
@@ -29,6 +29,8 @@ struct _SpiceAudioPrivate {
GMainContext *main_context;
};
+SpiceAudio* spice_audio_new(SpiceSession *session, GMainContext *context, const char *name);
+
void spice_audio_get_playback_volume_info_async(SpiceAudio *audio, GCancellable *cancellable,
SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data);
gboolean spice_audio_get_playback_volume_info_finish(SpiceAudio *audio, GAsyncResult *res,
diff --git a/src/spice-audio.h b/src/spice-audio.h
index 01f564a..b3d739b 100644
--- a/src/spice-audio.h
+++ b/src/spice-audio.h
@@ -103,11 +103,6 @@ GType spice_audio_get_type(void);
SpiceAudio* spice_audio_get(SpiceSession *session, GMainContext *context);
-#ifndef SPICE_DISABLE_DEPRECATED
-SPICE_DEPRECATED_FOR(spice_audio_get)
-SpiceAudio* spice_audio_new(SpiceSession *session, GMainContext *context, const char *name);
-#endif
-
G_END_DECLS
#endif /* __SPICE_CLIENT_AUDIO_H__ */
diff --git a/src/spice-session.c b/src/spice-session.c
index 238b5cb..f900bd1 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -33,7 +33,7 @@
#include "wocky-http-proxy.h"
#include "spice-uri-priv.h"
#include "channel-playback-priv.h"
-#include "spice-audio.h"
+#include "spice-audio-priv.h"
struct channel {
SpiceChannel *channel;
commit ee6f7e86e3e8da0c25c7b1fad6919fff39222d68
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Oct 27 18:41:35 2016 +0200
gdk: Ignore clipboard_get()'s deprecation warnings
Its implementation is modeled after gtk_dialog_run() which still uses
these deprecated thread functions.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c
index 7bed005..4be5711 100644
--- a/src/spice-gtk-session.c
+++ b/src/spice-gtk-session.c
@@ -808,11 +808,15 @@ static void clipboard_get(GtkClipboard *clipboard,
goto cleanup;
}
- /* apparently, this is needed to avoid dead-lock, from
- gtk_dialog_run */
+ /* This is modeled on the implementation of gtk_dialog_run() even though
+ * these thread functions are deprecated and appears to be needed to avoid
+ * dead-lock from gtk_dialog_run().
+ */
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gdk_threads_leave();
g_main_loop_run(ri.loop);
gdk_threads_enter();
+ G_GNUC_END_IGNORE_DEPRECATIONS
cleanup:
g_clear_pointer(&ri.loop, g_main_loop_unref);
commit 9ff67a108bb76e50a2c85a5054e6521088df1800
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Oct 27 18:41:43 2016 +0200
vncdisplaykeymap: Remove obsolete GTK+ 2 compatibility macros
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/src/vncdisplaykeymap.c b/src/vncdisplaykeymap.c
index c50f9f7..d0c9739 100644
--- a/src/vncdisplaykeymap.c
+++ b/src/vncdisplaykeymap.c
@@ -45,11 +45,6 @@
*/
-/* Compatability code to allow build on Gtk2 and Gtk3 */
-#ifndef GDK_Tab
-#define GDK_Tab GDK_KEY_Tab
-#endif
-
/* keycode translation for sending ISO_Left_Send
* to vncserver
*/
@@ -57,7 +52,7 @@ static struct {
GdkKeymapKey *keys;
gint n_keys;
guint keyval;
-} untranslated_keys[] = {{NULL, 0, GDK_Tab}};
+} untranslated_keys[] = {{NULL, 0, GDK_KEY_Tab}};
static unsigned int ref_count_for_untranslated_keys = 0;
@@ -87,41 +82,21 @@ static unsigned int ref_count_for_untranslated_keys = 0;
/* Xorg Cygwin aka XWin (offset + mangled XT keycodes) */
#include "vncdisplaykeymap_xorgxwin2xtkbd.c"
-/* Gtk2 compat */
-#ifndef GDK_IS_X11_WINDOW
-#define GDK_IS_X11_WINDOW(win) (1)
-#endif
#endif
#ifdef GDK_WINDOWING_WIN32
/* Win32 native virtual keycodes */
#include "vncdisplaykeymap_win322xtkbd.c"
-
-/* Gtk2 compat */
-#ifndef GDK_IS_WIN32_WINDOW
-#define GDK_IS_WIN32_WINDOW(win) (1)
-#endif
#endif
#ifdef GDK_WINDOWING_QUARTZ
/* OS-X native keycodes */
#include "vncdisplaykeymap_osx2xtkbd.c"
-
-/* Gtk2 compat */
-#ifndef GDK_IS_QUARTZ_WINDOW
-#define GDK_IS_QUARTZ_WINDOW(win) (1)
-#endif
#endif
#ifdef GDK_WINDOWING_BROADWAY
/* X11 keysyms */
#include "vncdisplaykeymap_x112xtkbd.c"
-
-/* Gtk2 compat */
-#ifndef GDK_IS_BROADWAY_WINDOW
-#define GDK_IS_BROADWAY_WINDOW(win) (1)
-#endif
-
#endif
#ifdef GDK_WINDOWING_X11
commit 9b9a6878b935806c831d3561cfa2cd6266368d6c
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Oct 27 18:41:28 2016 +0200
gtk: Ignore GLib's too-new warnings where we explicitly check its version
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
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
commit 1c1bcff6b96450e8865fe702c75542b63f75c569
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Thu Oct 27 18:41:20 2016 +0200
gtk: Remove an obsolete comment
The GTK+ compatibility code has been gathered in a single file long ago
and support for GTK+ 2 has been dropped anyway.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 06e332f..3ac0a7d 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -44,7 +44,6 @@
#include "vncdisplaykeymap.h"
#include "spice-grabsequence-priv.h"
-/* Some compatibility defines to let us build on both Gtk2 and Gtk3 */
/**
* SECTION:spice-widget
More information about the Spice-commits
mailing list