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 607393 - Improve client-side-windows binding
Improve client-side-windows binding
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: gdk
Git Master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on: 608153
Blocks: 607394
 
 
Reported: 2010-01-19 00:11 UTC by John Stowers
Modified: 2011-08-06 00:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Stowers 2010-01-19 00:11:53 UTC
Hi,

Please excuse this messy bug report. I had a successful attempt at re-implementing the mirror effect client-side windows demo in pygtk using pygtk 2.16.x and gtk 2.18.x

I was able to work around the unwrapped (int pygtk 2.16.x) functions using ctypes. As expected, this is not a bug. I noticed the new functions gdk_offscreen_window_set_embedder and gdk_offscreen_window_get_pixmap have been wrapped in the new bindings. Good.

I ran into problems with the GdkWidget::to-embedder and ::from-embedder signals. As can be seen here; http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#GdkWindow-to-embedder

This signal expects the catcher to return two values via two gpointer arguments. I noticed in git that there has been no override made to fix this signal. Please ensure that to-embedder and from-embedder are wrapped correctly so client-side-windows can be used in python

The pygtk example can found: http://gist.github.com/280520
Comment 1 Gustavo Carneiro 2010-01-24 23:06:45 UTC
(In reply to comment #0)
> I ran into problems with the GdkWidget::to-embedder and ::from-embedder
> signals. As can be seen here;
> http://library.gnome.org/devel/gdk/unstable/gdk-Windows.html#GdkWindow-to-embedder
> 
> This signal expects the catcher to return two values via two gpointer
> arguments. I noticed in git that there has been no override made to fix this
> signal. Please ensure that to-embedder and from-embedder are wrapped correctly
> so client-side-windows can be used in python

Overriding or handling signals is fully automatic, it does not require wrappers of any kind, nor does it allow overriding wrappers because wrappers do not exist.  The code to handling signals has been using runtime introspection since forever.

I don't think it will be possible to convert the gpointer embedder-x/y parameters.

One possible solution comes to mind, but it's ugly.  For one thing, pygtk is not prepared to handle multiple return values (as tuple).  It would require us to create a sort of gtk.Double proxy object, with GetValue/SetValue.  Moreover, we would need to patch gtk+ to register the signal parameters not as POINTER but as  a new registered pointer sub-type, let's call it GTK_TYPE_DOUBLE_PTR_OUT.  For the C API nothing would change, it would still be a pointer to double, but at pygtk side we would be able to register a custom type handler for GTK_TYPE_DOUBLE_PTR_OUT.  The gtk+ file gdkwindow.c needs to be patched to use this new GType in the g_signal_new instead of G_TYPE_POINTER.

*sigh* As usual, gtk+ developers don't think enough about language bindings... :-(
Comment 2 John Stowers 2010-01-26 13:29:01 UTC
> The gtk+ file gdkwindow.c needs to
> be patched to use this new GType in the g_signal_new instead of G_TYPE_POINTER.
> 
> *sigh* As usual, gtk+ developers don't think enough about language bindings...
> :-(

Filed as bug 608153.
Comment 3 John Stowers 2011-08-06 00:49:20 UTC
Closing API incompatible changes to pygtk - It is maintenance only now.