From: klute@heike.informatik.uni-dortmund.de (Rainer Klute)
Newsgroups: fj.mail-lists.x-window
Subject: Re: Drawing w/clipmask to obscurred window doesn't draw!
Date: 10 Sep 92 14:53:15 GMT
Distribution: fj
Organization: CS Department, Dortmund University, Germany

Date: 10 Sep 92 09:40:43 GMT
Message-Id: <18n56rINN2df@fbi-news.Informatik.Uni-Dortmund.DE>
Newsgroups: comp.windows.x

In article <4ssn2pm.richm@netcom.com>, richm@netcom.com (Richard Mauri) writes:
|> I have a motif drawing area widget (destination window)
|> that I draw vectors to with XDrawSegments() using a gc 
|> w/o a clip mask. Then I draw a filled rectangle using 
|> a gc with a clip mask. When the destination window is
|> not obcurred everything shows up ok and the backing store
|> I have requested is doing it's job when I later obscure
|> and expose the destination window. The problem is when
|> the destination window is obscurred at the time of drawing,
|> and then the destination window is exposed, only the segments,
|> not the clipmasked rectangle, get redrawn. Backing store
|> isn't doing it's job and I get no expose events either!

Two quotes from "Xlib - C Language X Interface, MIT X Consortium Standard,
X Version 11, Release 5" should answer your questions:

From chapter 3.2: "Attempts to output to the obscured area do nothing, and
no input events (for example, pointer motion) are generated for the
obscured area."

From chapter 3.2.4: "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
event 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 to the 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."

In a nutshell: You should not expect anything to happen if you draw
into an obscured region. In general you cannot rely on backing store.
It might be there or not, and if it is the server is allowed to give it up
at any time.

-- 
  Dipl.-Inform. Rainer Klute      klute@irb.informatik.uni-dortmund.de
  Univ. Dortmund, IRB
  Postfach 500500         |)|/    Tel.: +49 231 755-4663
D-W4600 Dortmund 50       |\|\    Fax : +49 231 755-2386