[comp.windows.x] Exposing one's windows

jdi@sparky.UUCP (John Irwin) (02/18/89)

Your message:

	(My message:)
        Note: This *won't* work if the window in question has a backing-store
	of type Always, and the server has enough resources to retain the
	window.  With such a window, you should wait for a MapNotify event
	before drawing.

    WRONG!  Even with such a window, you get an Expose event, and you should
    drive repaint based on the Expose event.

    (Perhaps you are confused by bugs in the unofficial backing store code that
    people used with R2.)
- --------

I commented before that you are correct and an exposure event is actually
delivered on the window.  I was confused by the fact that the exposure
happens at create-window time, not at map-window time.

So in implementating make-window-stream for Common Windows, I want to create
a backing-store :always window.  But I don't want to return from the function
until it's safe to draw on the window.  The window is not mapped at this time.

My question is: Am I guaranteed that I will get an exposure event on this
window when it is created?  My reading of page 21 of the Protocol Spec leaves
me wondering.  It says:

	"When no valid contents are available for regions of a window and the
	 regions are either visible or the server is maintaining backing store,
	 the server automatically tiles the regions with the window's
	 background...  Exposure events are then generated for the regions..."

So what happens if I ask for a backing-store :always window on an X terminal
that does support backing store, but doesn't happen to have enough memory
left to maintain backing store for this window?  Will I still get an exposure
event?  If I wait for the exposure at creation time and don't get it,
make-window-stream will never return.

	-- John

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (02/18/89)

    I want to create a backing-store :always window.
    Am I guaranteed that I will get an exposure event on this
    window when it is created?

No.  A server is free to ignore backing-store requests.

    If I wait for the exposure at creation time and don't get it,
    make-window-stream will never return.

Right.  You'll have to force a round-trip and then check for a locally
queued event.