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 307057 - gtkmozembed.MozEmbed open-uri signal handlers get called with wrong param
gtkmozembed.MozEmbed open-uri signal handlers get called with wrong param
Status: RESOLVED NOTGNOME
Product: gnome-python-extras
Classification: Deprecated
Component: general
2.11.x
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-09 20:14 UTC by Albert Huang
Modified: 2005-07-07 12:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Albert Huang 2005-06-09 20:14:33 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.
Comment 1 Albert Huang 2005-06-09 21:05:50 UTC
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
Comment 2 Gustavo Carneiro 2005-06-09 21:14:58 UTC
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... :|
Comment 3 Albert Huang 2005-06-09 21:23:15 UTC
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.
Comment 4 Gustavo Carneiro 2005-07-07 12:03:22 UTC
Mozilla bug #297238 appears to be progressing, so we don't have to do anything
on bindings side.