So I've analyzed the gnome-screensaver/gnome_bg_create_pixmap() problem a little further. I believe this is (arguably) a bug in libgnome-desktop: gnome_bg_create_pixmap() creates an X client with CloseDownMode set to RetainPermanent, and uses this client to create a new pixmap, which it then passes to gdk_pixmap_foreign_new().
However, when the ref count on this gdk pixmap drops to zero, gdk does not actually free the pixmap, because it has the is_foreign flag set (since it was created with gdk_pixmap_foreign_new()). So the dummy X client from libgnome-desktop is left with one pixmap forever. The problem is that libgnome-desktop just forgets about the pixmap it creates and passes to gdk_pixmap_foreign_new() as soon as gnome_bg_create_pixmap() returns, so it leaks.
However I'm not sure what a good fix for this is yet.
So I've analyzed the gnome-screensav er/gnome_ bg_create_ pixmap( ) problem a little further. I believe this is (arguably) a bug in libgnome-desktop: gnome_bg_ create_ pixmap( ) creates an X client with CloseDownMode set to RetainPermanent, and uses this client to create a new pixmap, which it then passes to gdk_pixmap_ foreign_ new().
However, when the ref count on this gdk pixmap drops to zero, gdk does not actually free the pixmap, because it has the is_foreign flag set (since it was created with gdk_pixmap_ foreign_ new()). So the dummy X client from libgnome-desktop is left with one pixmap forever. The problem is that libgnome-desktop just forgets about the pixmap it creates and passes to gdk_pixmap_ foreign_ new() as soon as gnome_bg_ create_ pixmap( ) returns, so it leaks.
However I'm not sure what a good fix for this is yet.