From ab9348b98c2f9c265f25064eac5ec0057156337c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 19 Jan 2009 05:15:57 +0000 Subject: [PATCH] Accept a type of TARGETS instead of ATOM, too. Based on a patch by Peng * gtk/gtkselection.c (gtk_selection_data_get_targets): Accept a type of TARGETS instead of ATOM, too. Based on a patch by Peng Wu. svn path=/trunk/; revision=22141 --- ChangeLog | 9 +++++++++ gtk/gtkselection.c | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a74f681648..e56dd8911b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-01-18 Matthias Clasen + + Bug 568263 – gtk can't recognize the wrong X Selection TARGETS' + type "TARGETS" by java applications + + * gtk/gtkselection.c (gtk_selection_data_get_targets): Accept + a type of TARGETS instead of ATOM, too. Based on a patch by + Peng Wu. + 2009-01-18 Matthias Clasen Bug 568233 – Wrong statement about GtkEntry's "activate" signal diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index f1ee12a905..8bc3ca9f20 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -1814,9 +1814,12 @@ gtk_selection_data_get_targets (GtkSelectionData *selection_data, { g_return_val_if_fail (selection_data != NULL, FALSE); + /* As usual, java gets it wrong and sets the type to TARGETS, not ATOM + */ if (selection_data->length >= 0 && selection_data->format == 32 && - selection_data->type == GDK_SELECTION_TYPE_ATOM) + (selection_data->type == GDK_SELECTION_TYPE_ATOM || + selection_data->type == gtk_selection_atoms[TARGETS])) { if (targets) *targets = g_memdup (selection_data->data, selection_data->length);