GNOME Bugzilla – Bug 601611
gtk_selection_data_get_targets() reads X Atom data as GdkAtoms
Last modified: 2009-11-28 15:32:23 UTC
Since bug 568263 landed (for 2.15.1), gtk_selection_data_get_targets() tries to return GdkAtom targets for data of type gtk_selection_atoms[TARGETS] without conversion. gdk_selection_property_get() does not convert data of type TARGETS to GdkAtoms. This can cause crashes when applications assume that |GdkAtom** targets| points to GdkAtoms. I assume the conversion should be done in gtk_selection_data_get_targets() as doing the conversion in gdk_selection_property_get() would create backward compatibility issues (unless it also changed ret_type to GDK_SELECTION_TYPE_ATOM but that might be a bit scary).
Looks like the Java bug is fixed now anyway, so probably the best solution to this bug is to remove the workaround from bug 568263 that causes this problem. http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=f9cc25b871a1bffffffffb8a0e123c0db94f?bug_id=6607163
I can reproduce it with OpenJDK/Fedora 12.
We can't do the conversion properly in gtk_selection_data_get_targets, since we don't have a display there. So I guess we should inddeed remove the broken workaround and rely on Java to fix their stuff. Martin, is there a bug filed against OpenJDK ? This should be fairly easy to fix...
commit 6dfb21e616bdf1e1db7ed86bff08fcb68210f17e Author: Matthias Clasen <mclasen@redhat.com> Date: Sat Nov 28 10:27:32 2009 -0500 Rework a broken workaround for a Java bug This was committed to fix bug 568263, but it is not correct, as pointed out in 601611.