Re: gtk3 replacement for gdk_pixmap_foreign_new



OK, here is what I discovered in replacing this code.

gdk_pixbuf_get_from_window() should work as a replacement (actually I
was using gdk_pixmap_get_from_drawable() before). However there may be
a problem with colormaps (I have not been able to test this yet, but
see below).

With gtk+ 2.x a colormap is required for
gdk_pixmap_get_from_drawable(), and the documentation says for screen
captures it is OK to use the default colormap for the screen. This is
in fact no longer the case !!! With Compiz, you need to create a 32
bit colormap (whereas the screen default is 24 bit). I have to use
gdk_visual_get_best_with_depth( depth_of_window ) followed by
gdk_x11_colormap_get_xcolormap() and gdk_x11_colormap_foreign_new().
depth_of_window is taken from the Xwindow and is 32 for Compiz.

- So therefore, I hope this is taken into consideration and something
similar done in the new function gdk_pixbuf_get_from_window() which
does not take a colormap parameter.


The other thing I noticed, gtk_socket_add_id() no longer seems to
work. Before it was kind of flakey...it didnt always work, and for
some reason it needed to be called twice in succession for it to work
at all. Now it does not work at all. However this is probably an X
Window issue, as trying to reparent a foreign window into a normal gdk
window seems not to work either. perhaps somebody could look into
that. However there seems to be another bug in gtk_socket_add_id() as
I get errors about the GtkSocket not being a GObject, and even being
mistaken for a PangoLayout object !




Regards,
Salsaman.










http://lives.sourceforge.net
https://www.ohloh.net/accounts/salsaman



On Fri, Jan 6, 2012 at 09:51, Olav Vitters <olav vitters nl> wrote:
> On Fri, Jan 06, 2012 at 12:51:32PM +0100, richard boaz wrote:
>> i have been caught by this in the past as well: that documentation related
>> to deprecated functions is woefully lacking.  it is emminently unhelpful to
>> simply state "stop using this call".
>
> File bugs.
>
> --
> Regards,
> Olav
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]