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
This commit is contained in:
Matthias Clasen 2009-01-19 05:15:57 +00:00
parent 3baf9b5e21
commit ab9348b98c
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2009-01-18 Matthias Clasen <mclasen@redhat.com>
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 <mclasen@redhat.com>
Bug 568233 Wrong statement about GtkEntry's "activate" signal

View File

@ -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);