From: Victor Toso <me@xxxxxxxxxxxxxx> We already iterate in all n_atoms and get its name with gdk_atom_name(), let's move the debug there too; While at it, move the generic SPICE_DEBUG of the function to the top. It should help us identify when the function was triggered but not used due the early returns. Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx> Acked-by: Pavel Grunt <pgrunt@xxxxxxxxxx> --- src/spice-gtk-session.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/spice-gtk-session.c b/src/spice-gtk-session.c index 798bdcd..3cd810a 100644 --- a/src/spice-gtk-session.c +++ b/src/spice-gtk-session.c @@ -604,6 +604,8 @@ static void clipboard_get_targets(GtkClipboard *clipboard, { SpiceGtkSession *self = free_weak_ref(user_data); + SPICE_DEBUG("%s:", __FUNCTION__); + if (self == NULL) return; @@ -632,19 +634,13 @@ static void clipboard_get_targets(GtkClipboard *clipboard, return; } - SPICE_DEBUG("%s:", __FUNCTION__); - if (spice_util_get_debug()) { - for (a = 0; a < n_atoms; a++) { - name = gdk_atom_name(atoms[a]); - SPICE_DEBUG(" \"%s\"", name); - g_free(name); - } - } - /* Set all Atoms that matches our current protocol implementation */ num_types = 0; for (a = 0; a < n_atoms; a++) { name = gdk_atom_name(atoms[a]); + + SPICE_DEBUG(" \"%s\"", name); + for (m = 0; m < SPICE_N_ELEMENTS(atom2agent); m++) { if (strcasecmp(name, atom2agent[m].xatom) != 0) { continue; -- 2.13.0 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel