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 623664 - Missing accessors for gtk_menu_get_position_func{,_data}
Missing accessors for gtk_menu_get_position_func{,_data}
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 597610
 
 
Reported: 2010-07-06 09:11 UTC by John Stowers
Modified: 2010-09-24 17:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Stowers 2010-07-06 09:11:26 UTC
For building PyGtk against Gtk-3.0 [1]

Subject is slightly misleading. More context in code comment [2]

     /* this is an ugly hack to avoid leaking memory and references
        gtk_menu_popup should use a data destroy function */
-    if (menu->position_func == pygtk_menu_position) {
-        cunote = menu->position_func_data;
+    if (menu->_g_sealed__position_func == pygtk_menu_position) {
+        cunote = menu->_g_sealed__position_func_data;
         Py_DECREF(cunote->func);
         Py_XDECREF(cunote->data);
         g_free(cunote);

[1] http://mail.gnome.org/archives/gtk-devel-list/2010-July/msg00005.html
[2] http://github.com/nzjrs/pygtk/blob/902c7fa012bc62cd0f927ff5d2642dff64a422be/gtk/gtk.override#L1624
Comment 1 Matthias Clasen 2010-07-06 13:39:25 UTC
That looks just wrong to me. If there is a problem with the data passed to the menu position func, we need a way to associate a destroy notify, not a hack like this.
Comment 2 John Stowers 2010-07-09 03:50:09 UTC
So would a patch adding gtk_menu_popup_full be considered?
Comment 3 Matthias Clasen 2010-07-10 04:02:00 UTC
yes
Comment 4 John Stowers 2010-09-20 01:07:46 UTC
I just noticed bug 345349 has a patch [1] that adds destroy notify to gtk_menu_popup_for_device. I wonder if it would be possible to just backport gtk_menu_popup_for_device to gtk+-2.22/4

https://bugzilla.gnome.org/show_bug.cgi?id=345349#c11
Comment 5 Matthias Clasen 2010-09-20 12:43:29 UTC
Ugh, that patch was meant to be attached here.
But no, backporting is not an option. gtk_menu_popup_for_device() is part of a complete rewrite of the input device handling code in gtk3.
Comment 6 Matthias Clasen 2010-09-20 13:17:38 UTC
You can probably work around the issue by using g_object_set_data and ::destroy.
Comment 7 Matthias Clasen 2010-09-24 17:56:40 UTC
Committed the patch mentioned in comment 4.