Re: Xlibs help on a applet.




You need to get a reference to the pixmap instead of creating one.

Have a look at the code4 around line 3726-3731 in gnome-libs/zvt/zvtterm.c
for some code that does this.

I think then you'll be able to write to it properly.

 Michael


> 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);
>     XCloseDisplay(dis);
>     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
> 
> 
> -- 
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.
> 
> 



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