Templated widget signals sometimes connected to wrong widgets
First up, I suspect that this is a GTK+ issue, but I thought it was sensible to file here in case it was related to e.g., Python object lifecycles/ref counting.
In some situations, child widgets instantiated by a template are not the widgets that get connected to the signals specified in that template. This affects Meld (see meld#343 (closed)) in current master, which is where I narrowed down the test case from... but I'm far from confident about what the conditions are.
In order to reproduce this, I had to have:
- a widget child in a templated widget
- have that templated widget constructed by another template (specifically a GtkPopover; I didn't test other parents)
I've used a RecentChooserWidget in the test case, but a GtkButton works just as well (and in fact is even weirder to me; the child widget in the callback isn't even the same widget as during __init__
).
The expected behaviour (to me) is that a child widget referenced by Template.Child()
will remain the widget to which its signals are connected for the entire lifetime of the parent widget.
This is a breakage against GTK+ 3.22.30 + pygobject 3.28.3, which is the last release pair that I'm confident about.