Open DirtYiCE opened 2 years ago
and gtk 2.24.33.
Uhm.... sorry, but... why? GTK 2 is end-of-life and GTK 2.24.33 is almost 1.5 years old.
I can't even find a GTK 2 package for Debian testing, so apparently Debian already got rid of this.
Could you try whether this problem also occurs with a current GTK version?
No, sorry, I don't have gtk3 installed, and I'd like to keep that abomination away from my system as long as possible. But I saw that there are gtk2 specific workarounds, so I thought it's still supported: https://github.com/lgi-devs/lgi/blob/60b66d3a283f277fece5cfdb507c7dc9a6309361/lgi/override/Gtk.lua#L634-L640
Wow, that code is nine years old: https://github.com/lgi-devs/lgi/commit/1a9d4931d52a1153ca33f03c809b94ed5ca7c24c
Also, I can't say that this is more or less supported than the rest of LGI. People use it. Sometimes they find problems. Sometimes they report them. Sometimes I can do something about the problems. Sometimes not.
But if I understand the code you found correctly, then... doesn't this try to make the child
property inaccessible because it does not work? And the above commit says that this comes from #58 and the backtrace in that issue looks quite a lot like the one you found.
So... apparently either the code you found or the the code here does not work any more. After nine years. It certainly looks different. Back then, this code was on "the main level" and these days it is wrapped in a if Gtk.Container
that comes from eeafbb5dd4a724811431e84edb4c259aa82b1961. Perhaps adding GTK4 support somehow broke GTK2?
Dunno, sorry.
Hmm, based on the comment I though it wanted to get rid of this: https://developer-old.gnome.org/gtk2/2.24/GtkBin.html#gtk-bin-get-child while still keeping the lgi's own child
override, but the commit message says otherwise.
It looks like gtk4 no longer has GtkContainer, that's why that if is required.
I don't know how that workaround worked originally, but now in ilua:
> require('lgi').Gtk.Bin._field
{}
> getmetatable(require('lgi').Gtk.Bin._field)
{__index=function: 0x7fd87995d120}
so I don't think that = nil
actually does anything.
If you want to invest more time into this:
You could try building the version with the above commit and see if it works. Then you could try a git bisect
to figure out when it broke and check if that finds anything useful.
No idea if this would actually help. This is all before I even knew lgi existed, I think.
I've tried to create a toy program, but it looks like as soon as I try to access a container's
child
property, it crashes.Here's a gdb backtrace:
In frame 1, tag is
GI_TYPE_TAG_INTERFACE
yetarg->v_string
clearly points to the stringlua
, so something is not alright here, but I have no idea what's wrong.Using lgi 0.9.2, lua 5.1.5 (but the same happens with luajit) and gtk 2.24.33.