GNOME Bugzilla – Bug 449318
API change in 2.11.4 borks pygtk-2.10.4
Last modified: 2008-01-03 18:07:10 UTC
gtktooltips.h contains a struct, _GtkTooltips, that contains an element GList *_tips_data_list; /* unused */ In gtk+-2.11.3, the element was named GList *tips_data_list; This element is used by pygtk-2.10.4 in ./gtk/gtk.override, To get pygtk to build I patched that file --- pygtk-2.10.4/gtk/gtk.override- 2007-06-19 20:39:19.000000000 -0400 +++ pygtk-2.10.4/gtk/gtk.override 2007-06-19 20:39:35.000000000 -0400 @@ -3127,7 +3127,7 @@ static PyObject * _wrap_gtk_tooltips__get_tips_data_list(PyGObject *self, void *closure) { - GList *list = GTK_TOOLTIPS(self->obj)->tips_data_list; + GList *list = GTK_TOOLTIPS(self->obj)->_tips_data_list; gint i, length; PyObject *pylist; GList *iter; The question is whether or not tips_data_list will be available in future, irrespective of the leading "_". If this element is to be removed, the pygtk team needs to make some changes. [I looked at SVN-trunk. pygtk still uses tips_data_list.] -Joseph
Redirecting this report to PYGTK. -Joseph
(In reply to comment #0) > gtktooltips.h contains a struct, _GtkTooltips, that contains an element > > GList *_tips_data_list; /* unused */ > > In gtk+-2.11.3, the element was named > > GList *tips_data_list; > > This element is used by pygtk-2.10.4 in ./gtk/gtk.override, this element will be useless in newer Gtk+ versions, which is why we did a slight rename to make it easier to catch cases like this. from the README: * The GtkTooltips struct (this is the old tooltips API) is now considered private. Code that used to access this struct, in particular the tips_data_list field, will need to change. the old tooltips are now maintained in a hash table instead of a list, so if you continue to use _tips_data_list, you could just as well write literally NULL there. the tooltip hashtable cannot be accessed, and the tooltips of the new tooltip system GtkTooltip can also not be accessed/enumerated.
Just a heads up: This issue is blocking the release of GNOME-2.19.4. (Downgrading gtk+ to 2.11.3 would result in all c++ apps not compiling, so we had to bump gtk+ up.) I probably should have commented sooner about this, sorry. (I assumed it was a simple fix and someone would do it in a few minutes. I shouldn't have assumed.)
Is seems to break the pygtk build on jhbuild sandbox: gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/opt/gnome2/include/python2.4 -I/opt/gnome2/include/pygtk-2.0 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I./gtk -I/opt/gnome2/include/pycairo -I/opt/gnome2/include/cairo -I/opt/gnome2/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome2/include/gtk-2.0 -I/opt/gnome2/lib/gtk-2.0/include -I/opt/gnome2/include/atk-1.0 -I/opt/gnome2/include/cairo -I/opt/gnome2/include/pango-1.0 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2 -Wall -std=c9x -fno-strict-aliasing -MT _gtk_la-gtk.lo -MD -MP -MF .deps/_gtk_la-gtk.Tpo -c gtk.c -fPIC -DPIC -o .libs/_gtk_la-gtk.o gtk.c: In function '_wrap_gtk_entry_get_inner_border': gtk.c:41290: warning: assignment discards qualifiers from pointer target type gtk.c: In function '__GtkNotebook_class_init': gtk.c:62730: warning: assignment from incompatible pointer type gtk.c:62750: warning: assignment from incompatible pointer type gtk.c: In function '__GtkScrolledWindow_class_init': gtk.c:68636: warning: assignment from incompatible pointer type ./gtk.override: In function '_wrap_gtk_tooltips__get_tips_data_list': ./gtk.override:3130: error: 'GtkTooltips' has no member named 'tips_data_list' make[2]: *** [_gtk_la-gtk.lo] Error 1 make[2]: Leaving directory `/home/luca/svn/gnome2/pygtk/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/luca/svn/gnome2/pygtk' make: *** [all] Error 2
I think bug #447214 is where this change was discussed and approved?
*** Bug 450044 has been marked as a duplicate of this bug. ***
Created attachment 90452 [details] [review] patch against trunk to remove accessors for private GtkTooltips struct
*** Bug 450440 has been marked as a duplicate of this bug. ***
(In reply to comment #7) > Created an attachment (id=90452) [edit] > patch against trunk to remove accessors for private GtkTooltips struct > This will break existing pygtk programs accessing these fields, which is something we should avoid.
You don't really have a choice as these fields are private and have been private.
(In reply to comment #10) > You don't really have a choice as these fields are private and have been > private. > Yes we do, the whole PyGTK API is public, there are no private parts of it regardless of private fields in gtk+. Even if a mistake was made to use a private API of Gtk+ we should still stick to the exported Python API. For instance, gtk.Tooltips.tips_data_list should probably just return an empty list. As for the other fields, it's probably better just to leave them as they were. I know that plenty of code exists out there that uses tip_window and tip_label.
Ok, if that is how you want to handle this, then you probably don't need to do anything as the incompatible renaming of the tips_data_list memeber is likely to be changed back in GTK+. And it will always contain NULL (the empty LIST).
I committed a fix to pygtk trunk (rev 2831) But I still think the change should be reverted to allow pygtk 2.10.4 to compile against gtk+ trunk.
Could you release a tarball as well?
(In reply to comment #14) > Could you release a tarball as well? > Unfortunately I don't have much time this week, maybe during the weekend or early next week.
*** Bug 452570 has been marked as a duplicate of this bug. ***
This API change has caused this bug in glChess: #459740.