GNOME Bugzilla – Bug 737587
[REGRESSION] Setting GtkSelectionData in the do_drag_data_get vmethod of a liststore does not work
Last modified: 2018-01-10 20:47:17 UTC
Created attachment 287350 [details] Test application demostrating the issue Subclassing Gtk.ListStore and setting the data in the do_drag_data_get vmethod used to work in 3.12 but it now does not work with 3.14. The selection data in the 'drag-data-received' callback is now different and the get_data method always return nothing anymore. Attaching a test application showing the issue. To reproduce, you should just try to reorder the entries. With PyGobject 3.12 no assert will happen with 3.14 you will get: Traceback (most recent call last):
+ Trace 234143
assert(the_data == WANTED_DATA) AssertionError
This is basically fallout from fixing bug 722899. As noted in bug 734465, the argument should probably be annotated as out or inout. But I'm not so sure about that after reviewing bug 736592 (TextIters cannot work as caller allocated out values without a new GBoxed assignment function). To fix the regression, we can extend the workaround used in bug 736175 to the hack for GtkTreeIters found in [1]. This solution is actually outlined in [2]. [1] https://git.gnome.org/browse/pygobject/tree/gi/pygi-struct-marshal.c?id=3.14.0#n563 [2] https://bugzilla.gnome.org/show_bug.cgi?id=661469#c16
For now I just hacked around the issue passing the data on the liststore directly[0] I think the 'right' solution here would be to work around that with the same kind of code as the one for "Gtk.TreeIter". I wonder if it would not be possible to make those boxed type refcounted upstream and change the copy method to just a new ref on the same struct? [0] https://git.gnome.org/browse/pitivi/commit/?id=cc2e00f89c8d5f036f636b34bbfd205df8f9bc5c
It would be great if this got fixed. Copy/paste is a bit annoying to do without it.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/90.