From: richm@netcom.com (Richard Mauri)
Newsgroups: fj.mail-lists.x-window
Subject: Re: Drawing w/clipmask to obscurred window doesn't draw!
Date: 14 Sep 92 12:51:28 GMT
Distribution: fj
Organization: Netcom - Online Communication Services  (408 241-9760 guest)

Date: 14 Sep 92 00:53:34 GMT
Message-Id: <07xns4#.richm@netcom.com>
Newsgroups: comp.windows.x

In article <1992Sep11.184158.3825@miki.pictel.com> oj@miki.pictel.com (Oliver Jones) writes:
>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....
>> 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!
>
>I take it things work properly if you disable backing store by setting
>it to NotUseful? ("Properly" means your program receives and processes
>the Expose event generated when the destination window is exposed.)
>If so, this is your workaround.  If not, I'd try to find out what's
>going on with your client before looking to the server as the source
>of the problem.
>
>In article <18n56rINN2df@fbi-news.Informatik.Uni-Dortmund.DE> 
>   klute@heike.informatik.uni-dortmund.de (Rainer Klute) quotes 
>   from the Xlib spec:
>
>>From chapter 3.2.4: ...
>>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.
>
>I always thought this meant that the server was supposed to 
>start generating Expose events again at the time it chose to 
>"stop maintaining" backing-store contents.  In particular,
>I thought the word "while" meant "during the time."
>
>It's possible Richard Mauri has found a bug.  I would have thought
>that the act of filling a rectangle through a GC clip (or any other
>drawing) into an obscured part of a window should have one of two
>effects:
>
>1) draw correctly into the backing store
>2) cause the server to decide to stop maintaining the
>   backing store, therefore causing it to perform
>   expose processing the next time the obscured part
>   of the window became uncovered.
>
>I didn't think the server had the option of BOTH ignoring a draw
>operation to backing store AND omitting subsequent expose processing.
>It's hard to imagine how a client would have the slightest chance of
>maintaining valid visible window contents under these circumstances.
>
>Can anyone clarify this?  Am I missing something?
>

When I DON'T request backing store prior to performing the
drawing and I perform the same sequence of events everything is OK.
My application gets an expose event and I can redraw. This "workaround"
basically says to me that backing store is USELESS for anything but
the most trivial drawing. I also thought that if a sever dishonors
backing store that it was guaranteed to pass expose events, but this
does not to seem to be true. More troubling is that this is not confined
to the xsun x11r4 server, my hp7000 server does this also!

Is this truely a bug. Does it exist in x11r5 (I don't have that server yet)

Has anyone ever managed to draw a graphic to a window with a clip mask,
while backing store was requested and previously honored,
while the window was obscurred and then exposed thew window and seen
the graphic or at least received an expose event?

Rich

because it points to a serious flaw in the backing store 
-- 
Richard Mauri               // Not ready to face the winter.
SW Eng / X hack             // Pray for wind.
Trimble Navigation Ltd.     // Pay the bills.
richm@netcom.com	    // Hope nothing breaks