Re: [gtk-list] Gdk, X11, and backing store



Dov Grobgeld wrote:
> 
> I have a question concerned with the lack of backing store in Gdk. I'm
> not a big expert on X, but one of the things that I have picked up is
> that if when you create a window do:
> 
>     unsigned long valuemask;
>     XSetWindowAttributes attributes;
> 
>:
>     valuemask = CWBackingStore;
>     attributes.backing_store = WhenMapped;
>:
> 
>     win = XCreateWindow(... , valuemask, &attributes);
>     XMapWindow(dpy, win);
> 
> you no longer get any exposure events for the window, but the X server
> is taking care of the exposure events on its own by using backing_store.
> 
> For some reason not totally clear to me, it is much faster to use
> backing store than to do the exposure handling yourself by drawing in
> a pixmap and just copying it when you get the exposure event. I
> suspect that the X-server is using video-memory than is not visible on
> the screen, whereas such memory is not available for a user process,
> but I might be wrong.

I believe that the X server uses server-side resources for the backing
store, as you suspect.  If you want to do your own backing store-type
functionality, use XImage*() calls.  An XImage is a server-side
resource, whereas (IIRC) a pixmap is a client-side resource.

Server-side versus client-side makes a world of difference in many
situations, especially when running X over a network.

	Jeff




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