After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737587 - [REGRESSION] Setting GtkSelectionData in the do_drag_data_get vmethod of a liststore does not work
[REGRESSION] Setting GtkSelectionData in the do_drag_data_get vmethod of a li...
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: gobject
3.14.x
Other Linux
: High critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-29 13:15 UTC by Thibault Saunier
Modified: 2018-01-10 20:47 UTC
See Also:
GNOME target: ---
GNOME version: 3.13/3.14


Attachments
Test application demostrating the issue (1.73 KB, text/x-python)
2014-09-29 13:15 UTC, Thibault Saunier
Details

Description Thibault Saunier 2014-09-29 13:15:22 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):
  • File "./virtual_method.py", line 35 in _dragDataReceivedCb
    assert(the_data == WANTED_DATA) AssertionError

Comment 1 Simon Feltman 2014-10-01 04:42:07 UTC
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
Comment 2 Thibault Saunier 2014-10-01 07:39:01 UTC
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
Comment 3 Dustin Spicuzza 2015-10-17 02:30:10 UTC
It would be great if this got fixed. Copy/paste is a bit annoying to do without it.
Comment 4 GNOME Infrastructure Team 2018-01-10 20:47:17 UTC
-- 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.