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> Signed-off-by: Victor Toso <me@xxxxxxxxxxxxxx> --- 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 5f052ed..a3b34db 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; @@ -627,15 +629,6 @@ static void clipboard_get_targets(GtkClipboard *clipboard, selection = get_selection_from_clipboard(s, clipboard); g_return_if_fail(selection != -1); - 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); - } - } - if (s->clip_grabbed[selection]) { SPICE_DEBUG("Clipboard is already grabbed, ignoring %d atoms", n_atoms); return; @@ -645,6 +638,9 @@ static void clipboard_get_targets(GtkClipboard *clipboard, 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