GNOME Bugzilla – Bug 307057
gtkmozembed.MozEmbed open-uri signal handlers get called with wrong param
Last modified: 2005-07-07 12:03:22 UTC
Distribution/Version: Debian unstable According to python-gnome-extras documentation, signal handlers for the "open-uri" signal of a gtkmozembed.MozEmbed widget should be called with params <widget, url, data> The url parameter is incorrectly passed as a gobject.GPointer (the gpointer behind it does point to the char * representation of the URL) To fix, some line probably needs to be changed to PyString_FromString( pygpolinter->gpointer ); http://users.tmok.com/~relbs/mozembed-test.py demonstrates this bug found a workaround with jdahlin on IRC, am posting bug as instructed.
workaround python extension module is at http://users.tmok.com/~relbs/mozembedhack/ could be used in a python script like: . . browser = gtkmozembed.MozEmbed() browser.connect("open-uri", on_open_uri") . . . def on_open_uri(widget, uri, data=None): import mozembedhack real_uri = mozembedhack.fixuri( uri ) print real_uri
That's a mozilla bug, not gnome-python-extras. The signal registration has the parameter type wrong. Filed https://bugzilla.mozilla.org/show_bug.cgi?id=297238 I'm reticent to include your hack in g-p-e... :|
oh, wasn't intending hack to be included, just there to show how the uri should be converted. It's getting passed to the signal handler as a gobject.GPointer, when it really should be a python string created from the gpointer that gets passed to the signal handler. I would send in a correct patch myself, but I couldn't figure out how things worked in gtkmozembed, maybe I was looking in the wrong places.
Mozilla bug #297238 appears to be progressing, so we don't have to do anything on bindings side.