GNOME Bugzilla – Bug 607393
Improve client-side-windows binding
Last modified: 2011-08-06 00:49:20 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
(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... :-(
> 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.
Closing API incompatible changes to pygtk - It is maintenance only now.