I think you are somewhat confused. :-)
Pixmaps are always kept in the server.
There is really no sending done here, except for the initial creation of them (which is done by the time the constructor of GDK.Pixmap() returns)
Step Pike GDK X ----------------------------------------------------------------------- p=GDK.Pixmap() 1 1 1 <-- synchronous p2=GTK.Pixmap() 1+1 1+1 1 set_icon() 1+1 1+1 1 <-- async call p=0 0+1 0+1 1 <-- direct pike-ref gone p2=0 0+0 0+1 1 <-- GTK.Pixmap destroy scheduled backend called flush-to-x 0 0+1 2 <-- icon now set destroy call 0 0 2 <-- all gtk refs gone Free Pixmap 0 0 1 <-- synchronous -----------------------------------------------------------------------
Compare this with the alternative:
Step Pike GDK X ---------------------------------------------------------------------- p=GDK.Pixmap() 1 1 1 <-- synchronous set_icon() 1 1 1 <-- async call p=0 0 0 1 Free Pixmap 0 0 0 <-- synchronous backend called flush-to-x 0 0 0 <-- icon now set to non-existing image -----------------------------------------------------------------------
The solution is to actually handle refcounts correctly for GDK objects. Since they are now actual objects (in GTK 2.0) it's possible. :-)