>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: lvntfy.m,v 1.15 92/06/11 17:22:42 rws Exp $
>># 
>>#
>>TITLE LeaveNotify CH08
>>ASSERTION A LeaveNotify-1
When a LeaveNotify event is generated by a hierarchy
change, then the LeaveNotify event is delivered after any
hierarchy event.
>>STRATEGY
Create window1.
Create window2 on top of window1.
Select for LeaveNotify and UnmapNotify events on window2.
Move pointer to window2.
Call XUnmapWindow on window2.
Verify that UnmapNotify event was received on window2.
Verify that LeaveNotify event was received on window1.
Verify that pointer has remained where it was moved.
>>ASSERTION A LeaveNotify-2
When a LeaveNotify event is generated, then all clients
having set LeaveWindowMask event mask bits on the event
window are delivered a LeaveNotify event.
>>STRATEGY
Create clients client2 and client3.
Create window.
Move pointer inside of window.
Select for LeaveNotify events on window.
Select for LeaveNotify events on window with client2.
Select for no events on window with client3.
Warp pointer outside window.
Verify that a single LeaveNotify event was received.
Verify that a single LeaveNotify event was received by client2.
Verify that no events were received by client2.
>>ASSERTION - LeaveNotify-3
When a LeaveNotify event is generated, then clients not
having set LeaveWindowMask event mask bits on the event
window are not delivered a LeaveNotify event.
>>ASSERTION A LeaveNotify-4
When a LeaveNotify event is delivered and the child of the
event window contains the initial pointer position, then
subwindow is set to that child.
>>STRATEGY
Build window hierarchy.
Create the hierarchy.
Move pointer to inside of child window.
Set LeaveWindowMask event mask bits on the eventw.
Move pointer to outside  of windows.
Verify that a LeaveNotify event was received.
Verify that subwindow is set to the source window.
>>ASSERTION A LeaveNotify-5
When a LeaveNotify event is delivered and the child of the
event window does not contain the initial pointer position,
then subwindow is set to None.
>>STRATEGY
Build window hierarchy.
Create the hierarchy.
Move pointer to inside of window.
Set LeaveWindowMask event mask bits on the eventw.
Move pointer to outside  of windows.
Verify that a LeaveNotify event was received.
Verify that subwindow is set to None.
  since only one event was expected, it must be first in list
>>ASSERTION C LeaveNotify-6
If multiple screens are supported: When a LeaveNotify event
is delivered and the event and root windows are not on the
same screen, then x and y are set to zero.
>>STRATEGY
If multiple screens are supported:
  Create a window on the default screen.
  Create a window on the alternate screen.
  Warp the pointer into the first window.
  Grab the pointer for the first window.
  Warp the pointer to the alternate window.
  Verify that an LeaveNotify event was generated relative to the grab window.
  Verify that the x and y components of the event were set to zero.
>>ASSERTION - LeaveNotify-7
All LeaveNotify events are delivered before any related
EnterNotify events are delivered.
>>ASSERTION A LeaveNotify-8
When the pointer moves from window A to window B and A is
an inferior of B, then a LeaveNotify event is generated on
window A with detail set to NotifyAncestor and then on each
window between window A and window B, exclusive, with detail
set to NotifyVirtual.
>>STRATEGY
Build window hierarchy.
Move pointer to known location.
Set window B.
Set window A to child of window B.
Select for EnterNotify and LeaveNotify events on windows A and B.
Move pointer from window A to window B.
Verify that the expected events were delivered.
Verify that event delivered to window A with detail set to NotifyAncestor.
Verify events delivered, between window A and window B, exclusive,
in proper order.
Verify that detail is set to NotifyVirtual.
Verify that all LeaveNotify events are delivered before all
EnterNotify events.
>>ASSERTION A LeaveNotify-9
When the pointer moves from window A to window B and B is
an inferior of A, then a LeaveNotify event is generated on
window A with detail set to NotifyInferior.
>>STRATEGY
Build window hierarchy.
Move pointer to known location.
Set window A.
Set window B to child of window A.
Select for LeaveNotify and EnterNotify events on windows A and B.
Move pointer from window A to window B.
Verify LeaveNotify event received on window A.
Verify that detail is set to NotifyInferior.
Verify that all LeaveNotify events are delivered before all
EnterNotify events.
>>ASSERTION A LeaveNotify-10
When the pointer moves from window A to window B and there
exists a window C that is their least common ancestor, then
a LeaveNotify event is generated on window A with detail set
to NotifyNonlinear and then on each window between window A
and window C, exclusive, with detail set to
NotifyNonlinearVirtual.
>>STRATEGY
Build window hierarchy.
Move pointer to known location.
Set windows A, B, and C.
Select for LeaveNotify and EnterNotify events on window A and
between windows A and C, exclusive.
Select for LeaveNotify and EnterNotify events between windows B and C.
Move pointer from window A to window B.
Verify that event delivered to window A with detail set to NotifyNonlinear.
Verify events delivered in proper order.
Verify that detail is set to NotifyNonlinearVirtual on events delivered on
each window between window A and window C, exclusive.
Verify that all LeaveNotify events are delivered before all
EnterNotify events.
>>ASSERTION C LeaveNotify-11
If the implementation supports multiple screens: When the
pointer moves from window A to window B and window A and
window B are on different screens, then a LeaveNotify event
is generated on window A with detail set to NotifyNonlinear.
>>STRATEGY
Check to see if multiple screens are supported.
Build window hierarchy.
Move pointer to window A.
Select for LeaveNotify and EnterNotify events on windows A and B.
Move pointer from window A to window B.
Verify that the expected events were received.
Verify that detail is set to NotifyNonlinear.
Verify that all LeaveNotify events are delivered before all
EnterNotify events.
>>ASSERTION C LeaveNotify-12
If the implementation supports multiple screens: When the
pointer moves from window A to window B and window A and
window B are on different screens and window A is not a root
window, then, after the related LeaveNotify event is
generated with detail set to NotifyNonlinear, a LeaveNotify
event is generated on each window above A up to and
including its root, with detail set to
NotifyNonlinearVirtual.
>>STRATEGY
Check to see if multiple screens are supported.
Create client.
Build window hierarchy.
Move pointer to window A.
Select for LeaveNotify and EnterNotify events on windows A and B.
Move pointer from window A to window B.
Verify that the expected events were received.
Verify that detail is set to NotifyNonlinear for event delivered to A.
Verify events delivered on each window above A up to and
including its root, with detail set to NotifyNonlinearVirtual.
Verify that all LeaveNotify events are delivered before all
EnterNotify events.
>>ASSERTION C LeaveNotify-13
If multiple screens are supported: When a LeaveNotify event
is delivered and the event and root windows are not on the
same screen, then same_screen is set to False.
>>STRATEGY
If multiple screens are supported:
  Create a window on the default screen.
  Create a window on the alternate screen.
  Warp the pointer into the first window.
  Grab the pointer for the first window.
  Warp the pointer to the alternate window.
  Verify that an LeaveNotify event was generated relative to the grab window.
  Verify that the same_screen component of the event was False.
>>ASSERTION A LeaveNotify-14
When a LeaveNotify event is delivered and the event window
is the focus window, then focus is set to True.
>>STRATEGY
Build window hierarchy.
Set input focus to eventw.
Move pointer to window.
Select LeaveNotify events on the eventw.
Call XWarpPointer to move the pointer to outside of window.
Verify event was delivered with focus set to True.
Move pointer back to window.
Set input focus to known window.
Call XWarpPointer to move the pointer to eventw.
Verify event was delivered with focus set to False.
>>ASSERTION A LeaveNotify-15
When a LeaveNotify event is delivered and the event window
is an inferior of the focus window, then focus is set to
True.
>>STRATEGY
Build window hierarchy.
Set input focus to ancestor of window eventw.
Move pointer to event window.
Select LeaveNotify events on the eventw.
Call XWarpPointer to move the pointer outside event window.
Verify event was delivered with focus set to True.
