[comp.windows.x] save_under quiz for xperts!

jdb26@LOCAL.UUCP (05/18/91)

If you have save_under specified for a popup window and the
contents of the window under the popup changes, what is the
correct behavior for a server when the popup is unmapped?

A) Restore the contents of the window under the popup, thus losing the
   changes made while the window was obscured?

B) Recognize the contents were changed and send an expose event to the
   window.

OpenWindows 2.0 appears to do (A).


Jeff Bailey                        |  All opinions are my own and do not
Chemical Abstracts Service         |  necessarily reflect those of my
Columbus, OH 43221                 |  employer.
(614) 447-3600 (x3092)             |
                                   |
BITNET: jdb26@cas.bitnet           |
UUCP:   osu-cis!chemabs!jdb26      |

nazgul@alphalpha.com (Kee Hinckley) (05/18/91)

In article <9105172046.AA01600@cas.org> jdb26@LOCAL.UUCP writes:
>If you have save_under specified for a popup window and the
>contents of the window under the popup changes, what is the
>correct behavior for a server when the popup is unmapped?
>
>A) Restore the contents of the window under the popup, thus losing the
>   changes made while the window was obscured?
>
>B) Recognize the contents were changed and send an expose event to the
>   window.
>
>OpenWindows 2.0 appears to do (A).

I'm not entirely sure why this is happening (I'm not explicitly
asking for save_unders in my dialogs) but whatever OW2.0 does,
it screws up the display.  I often see the following:

Dialog 1 is mapped on top of a cmdtool.
Dialog 2 is mapped on top of Dialog 1.
Dialog 1 is unmapped.
Dialog 2 is unmapped.
The underlying window now is "restored" to have an image of
Dialog 1 on it (clipped to where Dialog 2 was of course).

-- 
Alfalfa Software, Inc.          |       Poste:  The EMail for Unix
nazgul@alfalfa.com              |       Send Anything... Anywhere
617/646-7703 (voice/fax)        |       info@alfalfa.com

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

gildea@expo.lcs.mit.EDU (Stephen Gildea) (05/21/91)

    If you have save_under specified for a popup window and the
    contents of the window under the popup changes, what is the
    correct behavior for a server when the popup is unmapped?

    A) Restore the contents of the window under the popup, thus losing the
       changes made while the window was obscured?

    B) Recognize the contents were changed and send an expose event to the
       window.

There is at least one other option, which the MIT sample server uses:

C) Keep track of the changing contents (as if the obscured window had
   backing store) and restore those contents when the popup is
   unmapped.  No expose events are sent.

Remember, if it truly supports save unders, the server should not be
sending expose events.  Thus neither A nor B is a proper solution.   

 < Stephen
   MIT X Consortium

mrm@nss1.com (Michael R. Miller) (05/22/91)

In article <1991May18.155243.26271@alphalpha.com> nazgul@alphalpha.com (Kee Hinckley) writes:
>In article <9105172046.AA01600@cas.org> jdb26@LOCAL.UUCP writes:
>>If you have save_under specified for a popup window and the
>>contents of the window under the popup changes, what is the
>>correct behavior for a server when the popup is unmapped?

Having spent some time inside the server, when a window is only partially
exposed and drawing operations would be clipped while save unders are active,
the server (should) draw the unexposed graphics op on the pixmap it is
keeping to accomplish save unders.  I obtained this information by writing
and debugging servers for the X11R4 source tree: I'm not able to comment
on other versions such as X11R5 as yet.

Michael R. Miller
uunet!xzaphod!michael

dwig@b11.ingr.com (David Wiggins) (05/22/91)

gildea@expo.lcs.mit.EDU (Stephen Gildea) writes:

>    If you have save_under specified for a popup window and the
>    contents of the window under the popup changes, what is the
>    correct behavior for a server when the popup is unmapped?

>    A) Restore the contents of the window under the popup, thus losing the
>       changes made while the window was obscured?

>    B) Recognize the contents were changed and send an expose event to the
>       window.

>Remember, if it truly supports save unders, the server should not be
>sending expose events.  Thus neither A nor B is a proper solution.   

The Protocol says:

     If save-under is True, the server is advised that when
     this window is mapped, saving the contents of windows
     it obscures would be beneficial.

I read this to mean that setting save-under was just a hint that the
server could ignore at any time.  With this interpretation, B does not
violate the protocol, and is thus a proper solution.

> < Stephen
>   MIT X Consortium

David P. Wiggins
Intergraph

Dave.Rosenthal@eng.sun.COM (David Rosenthal) (05/23/91)

> >Remember, if it truly supports save unders, the server should not be
> >sending expose events.  Thus neither A nor B is a proper solution.   
> 
> The Protocol says:
> 
>      If save-under is True, the server is advised that when
>      this window is mapped, saving the contents of windows
>      it obscures would be beneficial.
> 
> I read this to mean that setting save-under was just a hint that the
> server could ignore at any time.  With this interpretation, B does not
> violate the protocol, and is thus a proper solution.
> 
Correct.  Requesting save-under is a hint.  It does not prevent the
server from sending expose events if it wants to.  For example,  if the
server was short of memory when the save-under window obscured another
it might well decide not to do the save-under this time and just send
the Expose events.

	David.