Xlibs help on a applet.

I've run across a bug in my applet.  I am drawing backgrounds on the root window
and in order to keep transparent terminals from crashing when my program exits
(because the backgroundPixmap is no longer in memory) I am using: 

    dis = XOpenDisplay(gdk_display_name);
    XSetCloseDownMode(dis, RetainPermanent);
    pix = XCreatePixmap(dis, DefaultRootWindow(dis), w, h, vis->depth);
    if (gpix) gdk_imlib_free_pixmap(gpix);
    gpix = gdk_pixmap_foreign_new(pix);

So that the Pixmap data sticks around.  This may or may not be the best way to
do it but it is the only thing I found that works.  Only now I have a problem
that it eats up an Xclient every time I change the background.  Eventually the
applet crashes due to a lack of Xclients and I only get one back.

I tred using 

XKillClient(dis, pix);

but this didn't seem to help.

Can anybody give me a way to get rid of my old XClients that I don't need
anymore or another way to keep the background Pixmap after my applet exits?

Thanks in advance.

                                        -Govind Salinas
"The Night is my companion and Solitude my guide."
        -Sarah McLachlan.
ICQ:32026672                                    AIM:DyErthScum

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