Community
Participate
Working Groups
It was used in DropTarget.setEventData where the list was iterated using g_list_nth and GtkTargetPair struct recreated on the java side. It is way more simple and effective to use g_list_nth_data which gives us exactly what we need, reduces java/c roundtrips and allows to be compiled on GTK 3. Commit/patch: http://fedorapeople.org/cgit/akurtakov/public_git/eclipse.platform.swt.git/commit/?h=NoGtkTargetPair&id=68cf18c4dc54af50971bdb807bf2eb3f26ee2696 Silenio, I tested it as much as I can and haven't found any issue but please take a look before I commit it.
This works because the "target" is the first field of the GtkTargetPair structure and it is a pointer as well, so the address of struct.targets is the same as the address of the struct. We can safely assume this is going to work as long as GTK does not break binary compatibility. But if that happens we would have bigger problems.
Are you fine with merging this in ? I agree that it works by accident but I didn't managed to find another way and if gtk breaks compatibility it will surely be GTK 4.x which I think we can ignore for now.
yes, go ahead.
Merged to master. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=df2aec5c90d07756dc802b7f295801f7f8f7b06a