Backing Store

Glynn Clements glynn at gclements.plus.com
Mon Mar 26 12:40:59 PDT 2007


Gordon Miller wrote:

> I am returning to a project that I left some years ago, which relies on 
> Backing Store. I create the windows and draw on them, before they are 
> mapped, and XMapRaise them at the end. This no longer seems to work.
> 
> Has the Xorg server changed in relation to backing store ?
> Has the Xlib drawing scenario changed such that a window needs to be 
> mapped before you can draw on it ?
> Is it just that my driver "radeon" doesn't do backing store correctly ?

The backing store attribute is a hint; the server doesn't have to
honour a request to use backing store:

    3.2.4.  Backing Store Attribute
    
    Some implementations of the X server may choose to maintain the
    contents of InputOutput windows. If the X server maintains the
    contents of a window, the off-screen saved pixels are known as backing
    store. The backing store advises the X server on what to do with the
    contents of a window. The backing-store attribute can be set to
    NotUseful (default), WhenMapped, or Always.
    
    A backing-store attribute of NotUseful advises the X server that
    maintaining contents is unnecessary, although some X implementations
    may still choose to maintain contents and, therefore, not generate
    Expose events. A backing-store attribute of WhenMapped advises the X
    server that maintaining contents of obscured regions when the window
    is mapped would be beneficial. In this case, the server may generate
    an Expose ev ent when the window is created. A backing-store attribute
    of Always advises the X server that maintaining contents even when the
    window is unmapped would be beneficial. Even if the window is larger
    than its parent, this is a request tothe X server to maintain complete
    contents, not just the region within the parent window boundaries. 
    While the X server maintains the window's contents, Expose events
    normally are not generated, but the X server may stop maintaining
    contents at any time.
    
    When the contents of obscured regions of a window are being
    maintained, regions obscured by noninferior windows are included in
    the destination of graphics requests (and source, when the window is
    the source). However, regions obscured by inferior windows are not
    included.

If you want to be able to draw graphics whenever you choose, rather
than in response to Expose events, set a background pixmap for the
window and draw into that.

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list