>># 
>># 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: bttnprss.m,v 1.12 92/06/11 17:18:17 rws Exp $
>># 
>>#
>>TITLE ButtonPress CH08
>>ASSERTION B ButtonPress-1
When any pointer button is pressed, then a ButtonPress
event is generated.
>>STRATEGY
If extended testing is enabled:
  Create window.
  Select for ButtonPress events.
  Generate ButtonPress event.
  Verify that a ButtonPress event was delivered.
  Verify that event member fields are correctly set.
>>ASSERTION B ButtonPress-2
When a ButtonPress event is generated and no active pointer
grab is in progress and at least one ancestor of the source
window has a matching passive grab on the pressed pointer
button, then the X server activates a passive grab for the
first ancestor of the source window, searching from the root
window down.
>>STRATEGY
If extended testing is enabled :
  Create a window.
  Create a child window.
  Create a child of the child.
  Select input on EnterNotify events for all of the windows.
  Select passive grabs for all the windows on Button1.
  Simulate a ButtonPress event.
  Verify that the child windows did not receive EnterNotify events.
  Verify that the oldest ancestor window received an EnterNotify with mode NotifyGrab.
  Simulate a ButtonRelease event.
  Release the passive grabs.
>>ASSERTION B ButtonPress-3
When a ButtonPress event is generated and no active pointer
grab is in progress and no ancestor of the source window has
a matching passive grab on the pressed pointer button, then
the X server automatically starts an active grab for the
client receiving the event and sets the last-pointer-grab
time to the current server time.
>>STRATEGY
Report UNTESTED
>>ASSERTION B ButtonPress-4
When a ButtonPress event is generated and no active pointer
grab is in progress and no ancestor of the source window has
a matching passive grab on the pressed pointer button and no
client has selected for button presses on the event window,
then the event is discarded.
>>STRATEGY
If extended testing is enabled:
  Create window.
  Select for all events except ButtonPress.
  Generate ButtonPress event.
  Verify that no event was delivered.
>>ASSERTION B ButtonPress-5
When a ButtonPress event is generated, then all clients
having set ButtonPressMask event mask bits on the event
window are delivered a ButtonPress event.
>>STRATEGY
If extended testing is enabled:
  Create window.
  Select for ButtonPress events.
  Generate ButtonPress event.
  Verify that a ButtonPress event was delivered.
  Verify that event member fields are correctly set.
Otherwise:
  Create window.
  Set ButtonPressMask event mask bits on window.
  Verify that no error occurred.
>>ASSERTION B ButtonPress-6
When a ButtonPress event is generated, then clients not
having set ButtonPressMask event mask bits on the event
window are not delivered a ButtonPress event.
>>STRATEGY
If extended testing is enabled:
  Create window.
  Select for all events except ButtonPress.
  Create a second client.
  Select for ButtonPress events on the window
  Generate ButtonPress event.
  Verify that a ButtonPress event was delivered.
  Verify that no event was delivered to the other client.
>>ASSERTION B ButtonPress-7
When a ButtonPress event is generated and no client has
selected ButtonPressMask on the source window, then the
event propagates, with propagation stopping at the root
window of the screen or at the first window with
ButtonPressMask in its do-not-propagate mask, from the
source window to the first ancestor window for which some
client has selected for ButtonPress events.
>>STRATEGY
If extended testing is required:
  Create a window.
  Create a child of that window.
  Create a child of the child.
  Select ButtonPress events on the root window.
  Simulate a ButtonPress event on the youngest child.
  Verify that a ButtonPress event was generated on the root.
  Select ButtonPress events on the oldest window.
  Set the do_not_propagate mask of its child to ButtonPress events.
  Simulate a ButtonPress event on the youngest child.
  Verify that no created window received a ButtonPress event.
  Clear the do_not_propagate mask on the oldest child.
  Set the do_not_propagate mask on the oldest window.
  Select for ButtonPress events on the oldest child.
  Simulate a ButtonPress on the youngest child.
  Verify that no ButtonPress event was sent to the oldest window.
  Verify that no ButtonPress event was sent to the youngest window.
  Verify that a ButtonPress event was sent to the oldest child.

>>ASSERTION B ButtonPress-8
When a ButtonPress event is delivered and the source window
is an inferior of the event window and the source window is
a child of the event window, then subwindow is set to the
source window.
>>STRATEGY
If extended testing is required:
  Create a window.
  Select ButtonPress events on that window.
  Create a child of that window.
  Simulate a ButtonPress event on the child.
  Verify that a ButtonPress event was delivered to the parent. 
  Verify that the subwindow component was the child of the event window.
>>ASSERTION B ButtonPress-9
When a ButtonPress event is delivered and the source window
is an inferior of the event window and the source window is
not a child of the event window, then subwindow is set to
the child of the event window that is an ancestor of the
source window.
>>STRATEGY
If extended testing is required:
  Create a window.
  Select ButtonPress events on that window.
  Create a child of that window.
  Create a child of the child.
  Simulate a ButtonPress event on the youngest child.
  Verify that a ButtonPress event was generated on the oldest parent.  
  Verify that the subwindow component was the child of the event window.
>>ASSERTION B ButtonPress-10
When a ButtonPress event is delivered and the source window
is not an inferior of the event window, then subwindow is
set to None.
>>STRATEGY
If extended testing is required:
  Create a window.
  Select ButtonPress events on that window.
  Simulate a ButtonPress event on the window.
  Verify that a ButtonPress event was generated.
  Verify that the subwindow component was None.
  Create a window.
  Grab the pointer with owner_events set to False.
  Simulate a ButtonPress event on the window.
  Verify that a ButtonPress event was generated on the grabbing window.
  Verify that the subwindow component was None.
>>ASSERTION D ButtonPress-11
If multiple screens are supported: When a ButtonPress 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:
  If extended testing is required:
    Create a window.
    Select ButtonPress events on that window.
    Create a window on the alternate screen.
    Grab the pointer with owner_events set to False.
    Simulate a ButtonPress event on the window.
    Verify that a ButtonPress event was generated on the grabbing window.
    Verify that the x and y  components are set to zero.
>>ASSERTION D ButtonPress-12
If multiple screens are supported: When a ButtonPress 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:
  If extended testing is required:
    Create a window.
    Select ButtonPress events on that window.
    Create a window on the alternate screen.
    Grab the pointer with owner_events set to False.
    Simulate a ButtonPress event on the window.
    Verify that a ButtonPress event was generated on the grabbing window.
    Verify that the same_screen component is set to zero.
